grep filtering question
in /tmp folder, i have around 30 web server log files, i want to retrieve lines with status code 4** and srcip not belong to 127.0.0.1 and 192.168.*.*
I go to /tmp and write below query: cat *.log | grep "status code:4**"| grep ^127.0.0.1 and ^192.168.*.* but it said ^127.0.0.1 no such file. any idea? do we need to use regex? |
what you posted is syntactically incorrect.
Code:
grep 'status code: 4..' *.log | grep -v 127.0.0.1 | grep -v '192.168.*.*' |
Quote:
Code:
grep 'status code:4..' *.log | grep -vE '^127.0.0.1|^192.168.*' etc. |
I want to filter out srcip=127.0.0.1 or 192.168.*.*
but we want dstip: 127.0.0.1 or 192.168.*.* |
Quote:
|
Quote:
Quote:
|
Quote:
Quote:
(If necessary, replace sensitive information with dummy strings, but don't change the format/structure of the line.) Also, use "[code]..[/code]" to preserve formatting. |
All times are GMT -5. The time now is 11:33 PM. |