Hello,
I would like to write a
sed comman dwith pattern matching .to match those record which have some character(userd id) present in it.
Example :
Logfile contents --
127.0.0.1 - - [30/Apr/2008:22:48:20 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 1866
127.0.0.1 - - [30/Apr/2008:22:48:44 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 1921
127.0.0.1 - - [30/Apr/2008:22:49:28 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 2145
127.0.0.1 - - [30/Apr/2008:22:49:39 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 2165
127.0.0.1 - - [30/Apr/2008:22:51:43 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 500 602
127.0.0.1 - jam [30/Apr/2008:22:53:02 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3228
127.0.0.1 - - [30/Apr/2008:22:53:54 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3228
127.0.0.1 - - [30/Apr/2008:22:54:58 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3234
127.0.0.1 - - [30/Apr/2008:22:55:26 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3234
127.0.0.1 - mpt [30/Apr/2008:22:56:19 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3234
127.0.0.1 - - [30/Apr/2008:22:57:04 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3229
127.0.0.1 - unix [30/Apr/2008:22:57:47 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3227
127.0.0.1 - forum [30/Apr/2008:22:58:14 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3218
---------
These are sample entries in a apache log file ..
I would like to write a
sed command to out put those record which have id present in 3rd column .
Out put needed --
127.0.0.1 - jam [30/Apr/2008:22:53:02 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3228
127.0.0.1 - mpt [30/Apr/2008:22:56:19 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3234
127.0.0.1 - unix [30/Apr/2008:22:57:47 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3227
127.0.0.1 - forum [30/Apr/2008:22:58:14 +0530] "POST /cgi-bin/cgi-module-example.pl HTTP/1.1" 200 3218
------------------------------------
I tried some think like
sed -n /([0-9]\{3})\.\1\.\1 - .? [aA-zZ-0-9].*/p access_log
but i am getting syntax error