0

I have an Apache log file I'd like to process with awk. But I'd like to process only lines after a certain date. I'm already converting the dates in the log file with the code found in https://stackoverflow.com/a/2115940/130121

Log file lines look like this:

 194.88.248.197 - - [18/Sep/2012:11:08:40 +0200] "GET start HTTP/1.1" 200 3063 "" "Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0"

How can I use a date that I give as a command line parameter to compare that date to the dates in the log file?

Community
  • 1
  • 1
chiborg
  • 23,387
  • 11
  • 88
  • 105

1 Answers1

0

gawk supports Time functions like mktime and strftime. You could use them to format the parameter and use the formated parameter in a pattern to select only the records you are intereste in.