You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a student, you are given a directory named log_files containing log files from multiple servers. The log files are named as "server1.log", "server2.log", etc. Each log file contains a list of errors observed on that server.
The error messages have a specific format: a timestamp followed by an error code and error message, separated by colons. For example:
2022-02-28T10:30:23Z:ERR0001:Permission denied.
2022-02-28T10:31:42Z:ERR0003:Failed to connect to the database.
Your task is to calculate the total number of errors with the error code 'ERR0003' found in all log files present in the log_files directory.
The answer must be an integer representing the total count of the 'ERR0003' error code in all log files.
init bash
echo "2022-02-28T10:30:23Z:ERR0001:Permission denied." > log_files/server1.log
echo "2022-02-28T10:31:42Z:ERR0003:Failed to connect to the database." >> log_files/server1.log
echo "2022-02-28T10:40:12Z:ERR0002:Invalid input." > log_files/server2.log
echo "2022-02-28T10:45:19Z:ERR0003:Failed to connect to the database." >> log_files/server2.log
echo "2022-02-28T10:50:28Z:ERR0003:Failed to connect to the database." >> log_files/server2.log"
The text was updated successfully, but these errors were encountered:
原始问题
As a student, you are given a directory named
log_files
containing log files from multiple servers. The log files are named as "server1.log", "server2.log", etc. Each log file contains a list of errors observed on that server.The error messages have a specific format: a timestamp followed by an error code and error message, separated by colons. For example:
Your task is to calculate the total number of errors with the error code 'ERR0003' found in all log files present in the
log_files
directory.The answer must be an integer representing the total count of the 'ERR0003' error code in all log files.
init bash
The text was updated successfully, but these errors were encountered: