Hello,
I have a samba log file I'm trying to pull data from (/var/log/samba/log.combined). Specifically, I am trying to pull all lines from the file where a specific IP is mentioned
Code:
less log.combined | grep 10.1.4.* > file1
However, this particular log file actually has two lines per data instance. Example:
Code:
[2012/04/12 03:03:46, 3] nmbd/nmbd_incomingrequests.c:process_name_query_request(454)
process_name_query_request: Name query from 10.1.4.54 on subnet 10.1.0.115 for name WPAD<00>
So, my grep returns data from the third line, but I also need the first line to know when said IP attempted access. How do I pull this off?
Thanks!
Bookmarks