Challenge: Log Error Extractor
In DevOps, being able to quickly identify errors in log files is essential for diagnosing issues and maintaining system reliability. Log files can be lengthy and filled with a variety of information, but your ability to extract and count error messages efficiently can save valuable troubleshooting time. In this challenge, you will write a Python script that processes a hardcoded list of log entries, extracts all lines containing the word ERROR, prints each error line, and counts the total number of errors found. This exercise simulates a simple log monitoring tool, a fundamental skill for any DevOps professional.
Swipe to start coding
Implement a script that extracts and counts error messages from a list of log entries.
- Iterate through each string in the
log_entrieslist. - Identify log entries that contain the word
"ERROR". - Print each error log entry.
- Print the total count of error entries.
Solução
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Can you show me an example of the log entries list?
What should the script do if there are no error messages in the logs?
Can you explain how to handle different error formats in the log entries?
Incrível!
Completion taxa melhorada para 4.76
Challenge: Log Error Extractor
Deslize para mostrar o menu
In DevOps, being able to quickly identify errors in log files is essential for diagnosing issues and maintaining system reliability. Log files can be lengthy and filled with a variety of information, but your ability to extract and count error messages efficiently can save valuable troubleshooting time. In this challenge, you will write a Python script that processes a hardcoded list of log entries, extracts all lines containing the word ERROR, prints each error line, and counts the total number of errors found. This exercise simulates a simple log monitoring tool, a fundamental skill for any DevOps professional.
Swipe to start coding
Implement a script that extracts and counts error messages from a list of log entries.
- Iterate through each string in the
log_entrieslist. - Identify log entries that contain the word
"ERROR". - Print each error log entry.
- Print the total count of error entries.
Solução
Obrigado pelo seu feedback!
single