LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 08: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 10:00 AM. Reason: Title corrected as requested.
 
Old 05-31-2012, 01:22 PM   #2
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Rep: Reputation: 24
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, 02:31 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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, 07: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



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 08:02 PM
Strange log entries in apache log under debian... hacking tentative ? strelok Linux - Security 4 11-11-2009 06:55 AM
a command or way to log time of iptables LOG entries? dividingbyzero Linux - Security 3 06-06-2008 01: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 04:13 PM

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

All times are GMT -5. The time now is 07:33 AM.

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
Open Source Consulting | Domain Registration