Solved

Need command to search syslogs

Posted on 2013-01-24
5
298 Views
Last Modified: 2013-01-25
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
0
Comment
Question by:dsingh006
  • 2
  • 2
5 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38816365
grep "123.123.123.123" /var/log/syslog
0
 

Author Comment

by:dsingh006
ID: 38816451
Yes I had tried that but this is the results
sudo less grep "xxx.xxx.xxx"/var/log/syslog
[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
0
 
LVL 9

Expert Comment

by:gt2847c
ID: 38816466
Try it this way:

sudo sh -c "grep xxx.xxx.xxx /var/log/syslog | less "
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38816486
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.
0
 
LVL 9

Accepted Solution

by:
gt2847c earned 500 total points
ID: 38816502
If the system has reasonable security applied, the syslog files should NOT be world-readable...
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question