I have a log file which has 1000+ line in the below format
<date> <time 1> {serial_no 1} {event:...} <message 1>
<date> <time 2> {serial_no 2} {event:...} <message 2>
<date> <time 3> {serial_no 3} {event:...} <message 3>
..
..
..
<date> <timen> {serial_non} {event:...} <message n>
I need to extract only particular message and its corresponding date and time and store those in a file.
Also need to extract those message which contains the keywords input from the command line.
Command line arguments can accept any number of keywords.
Example: >python file.py -k <key 1> -k <key 2> -k <key 3>
Output must contain all those messages with the input keywords with corresponding time and date. \
Need to format particular message from log file to simple sentence while giving the output since in log file the messages sentence are complicated and difficult to understand.
Would like to know which open source libraries in python can be used to format the above log file into structured format.