I am having a text file as follows
say
server.txt
Code:
Date Time server ip error code
--------------------------------------------------------------------------
02/21/2008 18:10:14 server1 xxx.xxx.xxx.xxx 6
02/21/2008 08:10:14 server2 xxx.xxx.xxx.xxx 196
03/21/2008 21:10:14 server8 xxx.xxx.xxx.xxx 96
03/21/2008 12:10:14 server9 xxx.xxx.xxx.xxx 132
04/21/2008 06:10:14 server4 xxx.xxx.xxx.xxx 254
04/21/2008 18:10:14 server6 xxx.xxx.xxx.xxx 6
I need a script to write lines to new file which satisfy the below condition
if
Date=02/21/2008 and
server=server1 and
error code=6 and
ip=xxx.xxx.xxx.xxx then that line should be written to
output.txt
Please let me know any script can satisfy all 4 condition strings in a line...
Thanks in advance