Hello all. I’m kind of in a bind and seeking some help. Let me first explain what I’m trying to do.
I have a log file, kind of like an apache log file, but its not from apache. What I’m looking to do is parse this file and pull out certain pieces for each line. I’m kind of stuck as to what function or method I should use to obtain what I need.
Here are two example lines in the log file(s):
xxx.xxx.xxx.xxx - - [29/Sep/2002:06:36:29 -0400] "GET /ucc/cgi-bin/go_get.pl?tableName=Classifieds1&STARTAT=51&WHERE_STR=WHERE+(Main_Classification+LIKE+'EMPLOYMENT')+AND+(Sub_Classification+LIKE+'HELP+WANTED') HTTP/1.1" 200 19698 "http://dbease.stratumnewmedia.com/ucc/cgi-bin/go_get.pl?tableName=Classifieds1&STARTAT=26&WHERE_STR=WHERE+(Main_Classification+LIKE+'EMPLOYMENT')+AND+(Sub_Classification+LIKE+'HELP+WANTED')" "Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)"
xxx.xxx.xxx.xxx - - [29/Sep/2002:13:59:00 -0400] "GET /ucc/cgi-bin/go_get.pl?tableName=Classifieds1&STARTAT=51&WHERE_STR=WHERE+(Main_Classification+LIKE+'EMPLOYMENT')+AND+(Sub_Classification+LIKE+'HELP+WANTED') HTTP/1.1" 200 19698 "http://dbease.stratumnewmedia.com/ucc/cgi-bin/go_get.pl?tableName=Classifieds1&STARTAT=26&WHERE_STR=WHERE+(Main_Classification+LIKE+'EMPLOYMENT')+AND+(Sub_Classification+LIKE+'HELP+WANTED')" "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)"
What I’m looking to do is pull out like maybe say the date possibly time and query string.
I’m currently trying to use the eregi() function, but not to familiar with it as of the moment. Maybe someone can help me out or show me a method that would be a lot better and/or easier.
Thanks