Sponsored Content
Top Forums Shell Programming and Scripting Fishing out error message within a log file Post 302078504 by Hitori on Saturday 1st of July 2006 07:57:32 AM
Old 07-01-2006
The script below reverses logfile then searches text between end and start:

Code:
#!/usr/bin/perl -w

open (INPUT, "< logfile");
for (reverse <INPUT>) {
    if (/end/ .. /start/) {
        last if /start/;

        if (/failure/) {
##################################
# failure detected: do hear what you want, e.g
            print 'FAILURE';
#################################
            last;
        }
    }
}

 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Append error message to the log

In my unix system , I chceck that there are error message append to the /var/adm/syslog . But I also found that part of these message will pop to my login session ( I use telent to login to server ) , I also check the /var/mail/my_loginid is empty , could suggest how can I forbid the message pop to... (1 Reply)
Discussion started by: ust
1 Replies

2. Shell Programming and Scripting

Send-file /var/log/message

Hello All i need Shell Script to send /var/log/message or another if he have or grep this file to have some info like PID or value (e.g like NFS mount - stop ) to some body in my System Thanks for Advanced (2 Replies)
Discussion started by: Hosam
2 Replies

3. UNIX for Dummies Questions & Answers

error message when use fork with open file

I get this message when I write myshell.c program "VM pagefault:SIGSEGV bad add 0x0 err 0x4 nopage read myshell PM: ciredump signal 11 for 1725 /myshell memory fault (core dumped)" /* RCS information: $Id: myshell.c,v 1.2 2006/04/05 22:46:33 elm Exp $ */ #include <stdio.h> #include <unistd.h>... (1 Reply)
Discussion started by: rosecomp
1 Replies

4. Shell Programming and Scripting

Help w/ script to read file and parse log message

Hi, I am working on the script to parsing the specific message like "aaaa" in multiple log files like N1-***,N2-***,N3-***... The script is to find the list of lof files which contains the message "aaaa" and export the list into excel filE. Can anyone give help? Thanks (2 Replies)
Discussion started by: shyork2001
2 Replies

5. Shell Programming and Scripting

Capture all error message in Log file and send the Log file by email

Hi I have a requirement to write a script to capture all errors in a Logfile and send the file in email. If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS. So I created a Log file and put the Appropriate... (2 Replies)
Discussion started by: dgmm
2 Replies

6. Shell Programming and Scripting

Extract XML message from a log file using awk

Dear all I have a log file and the content like this file name: temp.log <?xml version="1.0" encoding="cp850"?> <!DOCTYPE aaabbb SYSTEM '/dtdpath'> <aaabbb> <tranDtl> <msgId>000001</msgId> </tranDtl> ..... </aaabbb> ... ... (1 Reply)
Discussion started by: on9west
1 Replies

7. UNIX for Dummies Questions & Answers

Cp problems, file exists but error message

Basically, I want to copy all files (F03*) in this directory and merge/paste them into a new file (called SMER_2.03.12.SPU), yet the error message is "no such file or directory." I listed what is in my working directory, and the files do exist, so I'm not sure what's going on. The code's at the... (8 Replies)
Discussion started by: ucsdee
8 Replies

8. Shell Programming and Scripting

Searching Error Message from a log life between timestamp of every 10 minutes

HI Everyone, My task is to search error messages last 10 minutes everytime from a log file. My script, date1=`date -d '10 minutes ago' "+%H:%M:%S"` date2=`date "+%H:%M:%S"` awk -v d1="${date1}" -v d2="${date2}" '$0~d1{p=1} $0~d2{p=0} p' filename No error getting in... (3 Replies)
Discussion started by: ctscbe
3 Replies

9. UNIX for Beginners Questions & Answers

Colorful message is displayed in the terminal but not in the log file

Is there any way to print the colorful message in the terminal (which is the output of a simulation) to the log file with the same color. The colorful message at the terminal is obtained by the following codes: /////////////codes start here/////////////////////////////////////// ... (5 Replies)
Discussion started by: babunp114525
5 Replies
AMCLEANUP(8)						  System Administration Commands					      AMCLEANUP(8)

NAME
amcleanup - run the Amanda cleanup process after a failure SYNOPSIS
amcleanup [-k] [-p] [-r] [-v] config DESCRIPTION
Amcleanup generates the Amanda Mail Report and updates the Amanda databases after a system failure on a tape server host. This cleanup process is normally done automatically as part of the amdump program, but if amdump cannot complete for some reason (usually because of a tape server host crash), amcleanup must be run some time later (usually during system boot). The amcleanupdisk program is run with the same [-r] and [-v] options. See the amanda(8) man page for more details about Amanda. OPTIONS
-k Kill all process listed in the log file are their child. if there is no log file, then kill all amdump and amflush process and their child. -p Do the cleanup only if all process listed in the log file are already terminated. -r Remove bad file in holding disk. This options is passed to amcleanupdisk. -v Generate verbose output. This options is passed to amcleanupdisk. EXAMPLES
This example runs the Amanda cleanup process by hand after a failure. % amcleanup daily Putting the following line in a system boot script (e.g. /etc/rc.local) runs the Amanda cleanup process as part of the reboot, eliminating the need to run it by hand. /usr/local/sbin/amcleanup daily If nothing needs to be done, amcleanup exits normally with the message: amcleanup: no unprocessed logfile to clean up. SEE ALSO
amanda(8), amdump(8) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
James da Silva <jds@amanda.org> Stefan G. Weichinger <sgw@amanda.org> Amanda 3.3.1 02/21/2012 AMCLEANUP(8)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy