Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Parse and Summarize Log Data | Automating Everyday Engineering Tasks
Python for Automation Engineers
Section 1. Chapter 3
single

single

bookChallenge: Parse and Summarize Log Data

Swipe to show menu

Task

Swipe to start coding

Given a multiline string representing a system log, your task is to process the log and generate a summary report.

  • Extract all lines from the log that contain the word "ERROR".
  • Count how many times "ERROR", "WARNING", and "INFO" appear in the log.
  • Return a tuple containing the counts for "ERROR", "WARNING", "INFO", and a list of the extracted error lines.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 3
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt