dsingh006
asked on
Need command to search syslogs
Hi Experts
I am trying to track down an IP address on a unix DNS server using /var/log/syslog. However overwhelmed with data. I know very little of unix but I remember the Grep command as the "search" command. What would the command line be to pull the desired IP from this log?
Thanks in advance
D. arno
I am trying to track down an IP address on a unix DNS server using /var/log/syslog. However overwhelmed with data. I know very little of unix but I remember the Grep command as the "search" command. What would the command line be to pull the desired IP from this log?
Thanks in advance
D. arno
grep "123.123.123.123" /var/log/syslog
ASKER
Yes I had tried that but this is the results
sudo less grep "xxx.xxx.xxx"/var/log/sysl og
[sudo] password for mmmmm:
grep: No such file or directory
xxx.xxx.xxx/var/log/syslog : No such file or directory
Then it continues on to the whole log file
sudo less grep "xxx.xxx.xxx"/var/log/sysl
[sudo] password for mmmmm:
grep: No such file or directory
xxx.xxx.xxx/var/log/syslog
Then it continues on to the whole log file
Try it this way:
sudo sh -c "grep xxx.xxx.xxx /var/log/syslog | less "
sudo sh -c "grep xxx.xxx.xxx /var/log/syslog | less "
sudo should not be necessary. Syslog files are generally world-readable.
Leave a space between "123.123.123.123" and the filename.
And for the "less" thing - gt2847c's suggestion is correct.
Leave a space between "123.123.123.123" and the filename.
And for the "less" thing - gt2847c's suggestion is correct.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.