One of the things I wanted to do was to return just the part of the syslog that looks like this:
(L2L: <L2L Tunnel Name>)
Obviously I could grep '(L2L: .*)' filename.txt and get all of the lines that have that matched. But that still left a lot of gunk I didn't need. Thankfully grep has an answer. Adding the -o switch to grep results in just the matched text being returned. I was then able to pipe this to sort and then uniq to get my list of tunnels that had been accessed.
grep -o '(L2L: .*)' filename.txt | sort | uniq
Now comes the hard part of getting contact information for the old tunnels.
No comments:
Post a Comment