Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- hand = open('text.txt')
- for line in hand:
- line = line.rstrip()
- error_message = re.findall('^\[(.+?)\]', line)
- time_stamp = re.findall('"timestamp":"(.+)', line)
- if len(error_message) > 0:
- print(f"error message: {error_message[0]}, timestamp: {time_stamp[0]}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement