Hello.
I have a problem with reading a log file the way I want to.
I have many systems reporting errors to a file called "error.log" in a "main" system.
Only two of the systems in the file concerns me. (sys1 and sys2.)
To read the messages for the two systems I use the command:
This gives me only the information about sys1 and sys2.Code:tail -f error.log | egrep 'sys1'|'sys2'
However, this also gives me more information than I'd like.
Example of information given:
sys1 cooling warning
sys2 door open
sys2 cooling error
sys1 lost connection with hhut1
sys1 gained connection with hhut1
sys2 door closed
Lets say I want to exclude the information about cooling and door. My idea was to use this command:
My guess is that you know this does not work. I also guess that you know why.Code:tail -f error.log | egrep 'sys1|sys2' | egrep -v 'cooling|door'
Any one that care to help me out?
Bookmarks