# Remove duplicate addresses from the report. # If this line is in the format we're looking for, # The regex of the line we're looking for, built up from component regexps.Ĭombined_re = timestamp ". Ipv4 = "()"Ĭomment = "(Invalid user from " ipv4 " port )" # !! Match this format to your system's format. # Initialize empty list to hold addresses Writer = csv.DictWriter(args.outfile, fieldnames=fieldnames) Parser.add_argument('-o', '-outfile', help="Output file",ĭefault=sys.stdout, type=argparse.FileType('w'))įieldnames = Parser.add_argument('infile', help="Input file", type=argparse.FileType('r')) output.json parse_logs.py #!/usr/bin/env python3įormatter_class=argparse.RawDescriptionHelpFormatter) Pipe the output into jq if you'd like to peruse the response. If successful, the JSON response lists which reports were accepted and which were rejected. You can install it with pip3 install pytz Note: You'll need the pytz module installed. ![]() parse_logs.py secure.log > reports.csv
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |