Loading...
Parse Log Line
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Structured log lines arrive in the format 'LEVEL timestamp message' and need to be parsed into fields. Extract the level, timestamp, and message into a dict with those three keys. Treat everything after the second space as the message, which may itself contain spaces.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.