LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2012, 09:58 AM   #1
rebelbuttmunch
LQ Newbie
 
Registered: Sep 2011
Posts: 15

Rep: Reputation: Disabled
Monitoring log, but ignoring valid entries


Hi,

I deal with servers that print a lot of good and useless information. I want to be able to periodically search the daily log for something out of the ordinary.

Whats the best way to feed a list of log entries into some kind of search mechanism as a list of IGNORE these, but give me everything else?

Thanks!

Last edited by colucix; 05-31-2012 at 11:00 AM. Reason: Title corrected as requested.
 
Old 05-31-2012, 02:22 PM   #2
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch
Posts: 447

Rep: Reputation: 21
Quote:
Originally Posted by rebelbuttmunch View Post
Hi,

I deal with servers that print a lot of good and useless information. I want to be able to periodically search the daily log for something out of the ordinary.

Whats the best way to feed a list of log entries into some kind of search mechanism as a list of IGNORE these, but give me everything else?

Thanks!
With successive greps. Assuming log.txt is your log something like

grep -iv 'not this' log.txt | grep -iv 'nor that' | grep -iv 'nor this either'

Add as many as you need to exclude by the text you enter between the single quotes, or use double quotes if you want your exclusions by a regex

See man grep for details
 
Old 05-31-2012, 03:31 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Quote:
Originally Posted by rebelbuttmunch View Post
I want to be able to periodically search the daily log for something out of the ordinary.
Logwatch, Logcheck and Swatch are pretty good for that. Note 'out of the ordinary' can also be defined as "recurring too often" or "occurring sporadically". To find such lines there's 'petit' (see its "--hash" and "--wordcount" switches).
 
1 members found this post helpful.
Old 06-08-2012, 08:57 AM   #4
rebelbuttmunch
LQ Newbie
 
Registered: Sep 2011
Posts: 15

Original Poster
Rep: Reputation: Disabled
My problem is solved. Swatch was the way to go. Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Boot loader problems - GRUB has no valid entries thomas_r Linux - Newbie 11 09-29-2010 09:02 PM
Strange log entries in apache log under debian... hacking tentative ? strelok Linux - Security 4 11-11-2009 07:55 AM
a command or way to log time of iptables LOG entries? dividingbyzero Linux - Security 3 06-06-2008 02:23 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration