S
S
Sergey Sashkin2019-08-03 12:19:08
Python
Sergey Sashkin, 2019-08-03 12:19:08

How to validate a log file using bash and python?

There is a log file with hundreds of thousands of lines. You need to check that each line is valid json. If this is not the case, then output both the error line itself and the alleged error in this line.
Interested in a solution for both bash and python
Your thoughts gentlemen?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-08-03
@Zarom

What didn't work for you?
For bash, the most straight forward option is json_pp . The system is often present by default

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question