Monitoring specific string or keyword in rotating log files.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Monitoring specific string or keyword in rotating log files.
# 1  
Old 07-13-2010
Monitoring specific string or keyword in rotating log files.

Hi there,
I like to ask how i shall monitor specific string or keyword in rotating log files. e.g. I have at 10 rotating logfiles.
I use the command below to grep the string, but eventually become non functional because the logfile rotates and new logfile is active.
Code:
tail -f <logfile1> |grep <string>

Can you help how to resolve this?

Thank you.
# 2  
Old 07-13-2010
There is a package called swatch which has plenty of features for such purposes.
Just google for "swatch log file monitoring" for download, guides etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with rotating files

Hello: I have a script that gets the ACLs of the /home directory and its contents with getfacl and writes them to a file. The script is run by a cron job and I don't want it to rewrite or append to an already existing file. The point of backing permissions up is because I may need to restore them.... (2 Replies)
Discussion started by: Cacializ
2 Replies

2. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

3. Shell Programming and Scripting

Remove not only the duplicate string but also the keyword of the string in Perl

Hi Perl users, I have another problem with text processing in Perl. I have a file below: Linux Unix Linux Windows SUN MACOS SUN SUN HP-AUX I want the result below: Unix Windows SUN MACOS HP-AUX so the duplicate string will be removed and also the keyword of the string on... (2 Replies)
Discussion started by: askari
2 Replies

4. Shell Programming and Scripting

Monitoring for specific date stamped files before and after midnight

Hi Guys, I am having a brain freeze.... I want to monitor a directory for a time stamped file on a sol 10 system in bash or ksh, the files will come in looking like this.. randomfile.DDMMYY.rpt The problem i am having is the file can come in before or after midnight, the file will... (5 Replies)
Discussion started by: twinion
5 Replies

5. Shell Programming and Scripting

How to print Specific keyword, by using awk?

How to print Specific keyword, by using awk.? prime:root:I want output. 78 1457 10000 10000 5985 307 10000 10000 10000 10000 3760 692 6656 157 696 (4 Replies)
Discussion started by: ooilinlove
4 Replies

6. Solaris

rotating a log yearly

Hi, I am having some troubles using /usr/sbin/logadm to rotate sulog yearly. Can someone please assist with the correct syntax to rotate the sulog yearly? I'd like to maintain up to 3 years of logs. I am on Solaris 10. Thanks, (1 Reply)
Discussion started by: lwif
1 Replies

7. UNIX for Advanced & Expert Users

logrotate isn't rotating files any longer

I have been using logrotate for quite awhile now. Most logs are rotated daily, using /etc/cron.daily. I noticed that the logs in question have not been rotated since April 6, but daily up to that point. I have logrotate in /etc/cron.daily. The basic command is: /usr/sbin/logrotate... (1 Reply)
Discussion started by: manouche
1 Replies

8. UNIX for Dummies Questions & Answers

Monitoring specific files and folders

I want a mechanism to monitor a folder full of files that are sensitive. I want to log all accesses,modifications and changes to any file within the folder in a log file which should give me access/modify/change times,the user id of the process which tried and the pid. Even some idea of what to... (1 Reply)
Discussion started by: Vivek788
1 Replies

9. Solaris

rotating the syslogd and messages files

Im about to install a sunfreeware program called logrotate which does exactly what it says on the tin....just a quick question ..if its going to rename messages to messages.0 etc do I need to issue a HUP to syslogd after doing this or will the new messages file get created automatically cheers (2 Replies)
Discussion started by: hcclnoodles
2 Replies

10. Shell Programming and Scripting

Rotating a String

Hi folks, I want to rotate a string in Clock or Ani Clock wise. That is If the string is "TAMIL" the out put should be TAMIL AMILT MILTA ILTAM LTAMI TAMIL Please do help. (1 Reply)
Discussion started by: bubeshj
1 Replies
Login or Register to Ask a Question