Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Log Error Extractor | Monitoring and Log Analysis
Python for DevOps Beginners

bookChallenge: 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_entries list.
  • Identify log entries that contain the word "ERROR".
  • Print each error log entry.
  • Print the total count of error entries.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 3
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

bookChallenge: 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_entries list.
  • Identify log entries that contain the word "ERROR".
  • Print each error log entry.
  • Print the total count of error entries.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 3
single

single

some-alt