11-17-2008
script for finding an error from a log file
Hi ,
I have a doubt about a shell script to find an ERROR from the log file. But I need to specify a the scan from a particular date and time in the log. Till now I have developed the following script. Please suggest what shall I add in this for date and time. If the script finds a particular error it should throw 1 or else 0.
#!/bin/sh
# Script to find the error in the log file
ERROR="SCHD0061E"
read ERROR
if [ $ERROR="SCHD0061E" ] ;then
echo "1";
else echo "0"
fi
Kindly suggest what else is missing from this script. And how to specify the path for the log file .
Thanks & Regards
Last edited by himvat; 11-17-2008 at 03:25 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi Guys,
the requirement is like this,
i am having a error log file in this format,
4594.493: parallel nursery GC 2594592K->2544691K (2969600K), 30.848 ms
4605.958: parallel nursery GC 2634887K->2584986K (2969600K), 38.900 ms
4619.079: parallel nursery GC 2822555K->2774812K... (12 Replies)
Discussion started by: gsprasanna
12 Replies
2. Shell Programming and Scripting
Hi,
I have a .txt file (uniqfields.txt) with 3 fields separated by " | " (pipe symbol). This file contains unique values with respect to all these 3 fields taken together. There are about 40,000 SORTED records (rows) in this file. Sample records are given below.
1TVAO|OVEPT|VO... (2 Replies)
Discussion started by: RRVARMA
2 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I am trying to write a script for an application server log file where i want to put this script as a cron tab entry and it will check the server log file last 1000/500 line for every fifteen minute.
i am using the script like this.
count=`tail -n 1000 Trace.log | grep -c... (1 Reply)
Discussion started by: senthilkumar_ak
1 Replies
4. Shell Programming and Scripting
Shell script help
Here is 3 sample lines from a log file
<date> INFO <java.com.blah> abcd:ID= user login
<date> DEBUG <java.com.blah> <nlah bla> abcd:ID=123 user login
<date> INFO <java.com.blah> abcd:ID=3243 user login
I want to find unique "ID" from this log... (3 Replies)
Discussion started by: gubbu
3 Replies
5. AIX
Is there a way to find out the path/name of a script file that signaled my process? All that shows up from the signal info data is ksh. Even in getprocs64 is is just ksh. I am not sure why the full path and file name are not showing up instead of the shell name. I tried ptrace64 with PT_LDINFO but... (4 Replies)
Discussion started by: soccertl
4 Replies
6. Red Hat
Hell Guys,
Being a newbie, I need some help in finding a certain string from a log file of thousands of lines (around 30K lines) and have the output in a separate file.
Below is the file output -
10.155.65.5 - - "POST... (15 Replies)
Discussion started by: rockf1bull
15 Replies
7. Shell Programming and Scripting
Hi,
I have a log file that contains information such as this:
date
id number
command1
command2
command3
command4
data
data
data
date
id number
command1
command2
command3
command4 (4 Replies)
Discussion started by: bbbngowc
4 Replies
8. Shell Programming and Scripting
Hi there,
I have a log file that I need to check every 10 minutes to find if a specific error exists but only in that 10 minute period. The reason is that the log is quite large, and will frequently contain these errors, so I only want alerting if it in the last 10 minutes - I don't want... (3 Replies)
Discussion started by: paul_vf
3 Replies
9. Shell Programming and Scripting
So, I have a log file I need to search for ORA- errors.
If the only errors are: ORA-39082|ORA-39083|ORA-01917 then the script should have executed okay.
If there are ORA- errors that are in the log file other than above, then I need to send a mail saying that the script failed.
Any ideas... (1 Reply)
Discussion started by: cougartrace
1 Replies
10. Shell Programming and Scripting
I very new to C Shell. I am trying to do is read from Command line.
Find the if the file is zip, .txt, symbloic link,pipe, unknow (if file is not zip, txt, sy....)
here is what I what got so far. I am very stuck atm Please help me out :
If the file is symblooc link what file is link to
... (12 Replies)
Discussion started by: madbull41
12 Replies
LEARN ABOUT FREEBSD
rcsfreeze
RCSFREEZE(1) General Commands Manual RCSFREEZE(1)
NAME
rcsfreeze - freeze a configuration of sources checked in under RCS
SYNOPSIS
rcsfreeze [name]
DESCRIPTION
rcsfreeze assigns a symbolic revision number to a set of RCS files that form a valid configuration.
The idea is to run rcsfreeze each time a new version is checked in. A unique symbolic name (C_number, where number is increased each time
rcsfreeze is run) is then assigned to the most recent revision of each RCS file of the main trunk.
An optional name argument to rcsfreeze gives a symbolic name to the configuration. The unique identifier is still generated and is listed
in the log file but it will not appear as part of the symbolic revision name in the actual RCS files.
A log message is requested from the user for future reference.
The shell script works only on all RCS files at one time. All changed files must be checked in already. Run rcsclean(1) first and see
whether any sources remain in the current directory.
FILES
RCS/.rcsfreeze.ver
version number
RCS/.rcsfreeze.log
log messages, most recent first
AUTHOR
Stephan v. Bechtolsheim
SEE ALSO
co(1), rcs(1), rcsclean(1), rlog(1)
BUGS
rcsfreeze does not check whether any sources are checked out and modified.
Although both source file names and RCS file names are accepted, they are not paired as usual with RCS commands.
Error checking is rudimentary.
rcsfreeze is just an optional example shell script, and should not be taken too seriously. See CVS for a more complete solution.
GNU
23:37:10Z RCSFREEZE(1)