0

My server generated a json object for each request, so I dump that json object to a access.log file. In this case, each line of access.log is an json object. So How can I use jsawk to parse access.log ? Is there any option to switch on ?

Xing Shi
  • 2,152
  • 3
  • 21
  • 32

1 Answers1

1

A good work around, use awk to preprocess the access.log like this:

$ awk 'BEGIN {print "[";}  {print $0,",";} END {print "]";}' access.log 
> | jsawk "return this.sometag"
Xing Shi
  • 2,152
  • 3
  • 21
  • 32