?
Solved

Need command to search syslogs

Posted on 2013-01-24
5
Medium Priority
?
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 total points
ID: 38816502
If the system has reasonable security applied, the syslog files should NOT be world-readable...
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month12 days, left to enroll

752 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