I have a file with some contents as follows -
[1412272372] SERVICE ALERT: abc.com;value;WARNING;HARD;3;WARNING: 2014-09-14
[1412272412] SERVICE ALERT: def.com;value;WARNING;HARD;3;WARNING: 2014-09-14
[1412272432] SERVICE ALERT: fgh.com;value;WARNING;HARD;3;WARNING: 2014-09-14
[1412272442] SERVICE ALERT: fgh.com;value;WARNING;HARD;3;CRITICAL: 2014-09-14
From this, I want to grep the site name and date only, then save it to a new file. So after that the new file should be as follows -
abc.com - 2014-09-14
def.com - 2014-09-14
fgh.com - 2014-09-14
Any help would be appreciated.
Thanks in advance.
fgh.comentry for 2014-09-14 in the output, despite there being two lines in the input.grepalone may be not enough, butgrep+cut+sortcan be very powerful. The beauty of unix, lots of little programs that do one thing very well can be combined to achieve complex tasks!