Results 1 to 3 of 3
Hey forum,
I have a question which is driving me crazy,
I have a Apache web log file and I am trying to extract a string of text out of ...
- 10-18-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 2
Newbie has a grep problem
Hey forum,
I have a question which is driving me crazy,
I have a Apache web log file and I am trying to extract a string of text out of it . This is the piece of text i have copied from the log.
I am trying to extract from ?hl to "; and print out the entries to a file
/search?hl=en&q=frequently+used+unix+aliases&btnG=Google+Sea rch"; "Mozilla/4.0
Should i be using a grep command to do this?
Here is what I had been trying
grep '\<?hl+eta\>' logs.txt
any help is really great
Many thanks
Kaly
- 10-18-2011 #2
Is this what you want?
On a related note, apachegrep might be of interest also:Code:egrep -o '\?hl.*\";' logs.txt
apachegrep
Manpage of apachegrepYou must always face the curtain with a bow.
- 10-19-2011 #3Just Joined!
- Join Date
- Oct 2011
- Posts
- 2
Thanks a million Irithori, much appreciated it worked.


Reply With Quote