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 02-13-2012, 01:27 AM   #1
mikey_choudhary
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled
How to highlight Exception and failure in server.log file


Hi guys, I wanna highlighted display of some keywords like EXCEPTIONS and Failures in log file as it keep running.
thanxx
 
Old 02-13-2012, 01:43 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello and welcome to LinuxQuestions,

You could install colortail (most likely exists in your repositories) or multitail.

Looking forward to your participation in the forums. Have fun with Linux.

Kind regards,

Eric
 
1 members found this post helpful.
Old 02-13-2012, 02:51 AM   #3
mikey_choudhary
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I can't install anything as i m not superuser. what I am asking is, when I am monitoring server.log, there are thousands of request processing every seconds so I just want to monitor only failures n exceptions occurred.
when I do " cat server.log " or
" tail -f server.log "
it continually display all requests
but i want it to display only lines that containing Exception or errors
i don't want use grep or seek like commands because it doesn't display continuously...grep doesn't update automatically.
 
Old 02-14-2012, 12:00 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
This will do it
Code:
tail -f server.log|grep -E "failure|exception"
The tail cmd continuously feeds grep which only displays matched recs.
Note that its all case sensitive, so failure != Failure.
 
1 members found this post helpful.
Old 02-14-2012, 12:59 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by chrism01 View Post
Note that its all case sensitive, so failure != Failure.
grep's -i (or --ignore-case) option would solve that. Might be useful to add error to failure and exception.
 
1 members found this post helpful.
Old 02-14-2012, 01:15 AM   #6
mikey_choudhary
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
This will do it
Code:
tail -f server.log|grep -E "failure|exception"
The tail cmd continuously feeds grep which only displays matched recs.
Note that its all case sensitive, so failure != Failure.
Thanks man...this is what i was looking exactly.
keep it up.
 
  


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
How can i force Squid to log urls allowed as an exception launchck Linux - Security 1 08-15-2010 09:57 AM
In Apache server, How to change log file location and log format for access log fil? since1993 Linux - Server 1 08-19-2009 05:14 PM
Any tool to highlight lines with certain prefix in a file? n179911 Linux - Software 1 07-06-2009 05:08 AM
Java JDBC-Exception: Communications link failure Swift&Smart Programming 1 12-06-2007 12:12 AM
highlight text of a file from specified line number tanveer Linux - General 9 12-06-2006 11:27 PM

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

All times are GMT -5. The time now is 08:22 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration