Hi,
- I am trying to grep for two patterns from a set of 820 apache webserver logs,
- When I Try to search the pattern with a date stamp and use a wildcard character * for ex: /28/Aug/2008:21*/ to get all the log entries for that particular hour that is 21 st hour I get errors. Please kindly let me know where I am going wrong.
The following is the command I am trying to use:
perl -ne 'print if (/mckinskey@futuron.com/ ? ($c=1) : (--$c > 0)) ; print if (/28/Aug/2008:21*/ ? ($d = 1) : (--$d > 0))' request.log*
[m78i5@serv125 ~]$ perl -ne 'print if (/mckinskey@futuron.com/ ? ($c=1) : (--$c > 0)) ; print if (/28/Aug/2008:01:35*/ ? ($d = 1) : (--$d > 0))' request.log*
Bareword found where operator expected at -e line 1, near "/28/Aug"
(Missing operator before Aug?)
syntax error at -e line 1, near "/28/Aug"
Search pattern not terminated at -e line 1.
[m78i5@serv125 ~]$ perl -ne 'print if (/mckinskey@futuron.com/ ? ($c=1) : (--$c > 0)) ; print if (/28/Aug/2008:01*/ ? ($d = 1) : (--$d > 0))' request.log*
Bareword found where operator expected at -e line 1, near "/28/Aug"
(Missing operator before Aug?)
syntax error at -e line 1, near "/28/Aug"
Search pattern not terminated at -e line 1.
[m78i5@serv125 ~]$ perl -ne 'print if (/mckinskey@futuron.com/ ? ($c=1) : (--$c > 0)) ; print if (/28/Aug/2008:21*/ ? ($d = 1) : (--$d > 0))' request.log*
Bareword found where operator expected at -e line 1, near "/28/Aug"
(Missing operator before Aug?)
syntax error at -e line 1, near "/28/Aug"
Search pattern not terminated at -e line 1.
Thanks