sed script help/ideas
i have a simple sed script to pull certain lines from a log on my server, and dump it to another file.
my question is, what would be the easiest way modify these lines to remove all the stuff i dont want from them, say everything but the something.txt example of line 255.255.255.255 - - [20/Jul/2004:23:18:34 -0400] "GET /files/blah/something.txt HTTP/1.1" 200 1538048 script is like sed -n '/txt/ p' logfile >results.txt any suggestions are welcome. thx |
yay! i found the answer using awk. (and searching this forum)
now for counting occurences... |
I would use Perl like :
perl -p -e 's/^.*GET\s//;s/\s.*$//' /var/log/server-logs > parsed-logs cat parsed-logs | wc -l # counting occurences... |
All times are GMT -5. The time now is 06:01 PM. |