Unix Commands/Scripts for '#Grep log' - 6 Commands/Scripts found |
|
Sample 1. Finding any of the multiple texts strings in file | |
|
egrep 'Error|Exception|Debug' logfile.txt
|
|
Like Feedback egrep grep log grep |
|
|
Sample 2. Get lines containing any of the multiple errors / exceptions in running logs | |
|
tail -f /opt/WebSphere/AppServer/profiles/application/logs/SystemOut.log | egrep "(WSWS3713E|WSWS3734W|WSVR0605W|javax.net.ssl.SSLHandshakeException|ThreadMonitor)"
|
|
Like Feedback grep grep logs tail tail -f egrep |
|
|
Sample 3. Count a particular word ( error ) in a file | |
|
grep -c "Error" logfile.txt
|
|
Like Feedback grep grep log grep -c |
|
|
Sample 4. Finding relevant word and excluding irrelevant word | |
|
grep xception logfile.txt | grep -v ERROR
|
|
Like Feedback grep grep log grep -v |
|
|
|
Sample 5. Get all Errors in a log file for last n days in a seperate error file | |
|
find /LogFilesfolder/ -iname "SystemOut*" -mtime -7 -exec zgrep "| ERROR |" {} ; >> logReport.txt
|
|
Like Feedback find -iname -mtime zgrep find errors in log file |
|
|
Sample 6. Get Error Snippets in running logs | |
|
tail -f /opt/WebSphere/AppServer/profiles/application/logs/SystemOut.log | sed -n '/ERROR/,/EST/p'
|
|
Like Feedback grep grep logs tail tail -f sed sed -n |
|
|