Solved

Need command to search syslogs

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now