Hell Guys,
Being a newbie, I need some help in finding a certain string from a log file of thousands of lines (around 30K lines) and have the output in a separate file.
Below is the file output -
10.155.65.5 - - [20/Jan/2011:07:41:58 +0100] "POST /cas/login?post=true&service=http://test.domain.ca:8000/psp/ppf88prd/?cmd=login%26languageCd=CAN%26userid=VP1%26pwd=TEST123 HTTP/1.1" 200 888
Now what I am after is I need to separate the output after "&service=" and I need to catch the http:// url for now.
Please note that I need the output in a separate file with each search on a different line (basically neatly arranged).
Now one of the other problems is that the log file also contains some other log entries such as below:
19.489.50.8 - - [25/Jan/2011:00:00:11 +0100] "GET /cas/themes/testdomains/fondCas.jpg HTTP/1.1" 200 29659
17.538.23.034 - - [25/Jan/2011:00:00:12 +0100] "GET /cas/status.jsp HTTP/1.0" 200 104
And I need not check them since I am looking for log lines that have "&service=" and only wish to catch the url after this pattern on a separate line in a separate file.
I have looked up on a lot of threads doing similar things and lot of very helpful smalls conditions using grep, sed and awk being offered. Though being a novice in all these, I find it almost impossible to tweak them as per my requirement and thus I have posted it here.
Would really appriciate if someone can guide me on this.
Thanks,
Andy