1

Need to check in the error log on UNIX server for multiple sites, ex. lets say there are 3 sites ABC.com, XYZ.com and OPQ.com. i want to get error log from server for any of these sites lies.

I tried with

tail -99999  /apache/log/error_log| grep 'ABC | XYZ | OPQ'

But was not working..

1
  • One way: grep -e "ABC" -e"XYZ" -e "OPQ'. Another way: grep -P 'ABC|XYZ|OPQ' Commented Apr 22, 2014 at 10:45

3 Answers 3

3
tail -99999  /apache/log/error_log| grep -E '(ABC|XYZ|OPQ)'

or

tail -99999  /apache/log/error_log| grep -e ABC -e XYZ -e OPQ
Sign up to request clarification or add additional context in comments.

Comments

1

Just use egrep:

tail -99999  /apache/log/error_log| egrep '(ABC|XYZ|OPQ)'

Comments

1

Using awk

tail -99999  /apache/log/error_log | awk '/ABC|XYZ|OPQ/'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.