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
Solved

Need command to search syslogs

Posted on 2013-01-24
5
305 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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.

840 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