Looking for first instance of an error in explorer log


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Looking for first instance of an error in explorer log
# 1  
Old 12-10-2014
Tools Looking for first instance of an error in explorer log

Hi

How to see the first instance of an error in explorer log ?

In this case I want to know the first time error "SCSI transport failed" was populated in messages

Thanks

Amani
# 2  
Old 12-10-2014
Quote:
Originally Posted by amani
Hi

How to see the first instance of an error in explorer log ?

In this case I want to know the first time error "SCSI transport failed" was populated in messages

Thanks

Amani
Probably a rookie answer here, but if you're talking just scanning for the first error in a given log file, I've used this logic successfully in the past:

Code:
 
LN=`grep -n "<error>" <log_file> | head -1 | nawk -F: '{print $1}'`
let LNe=$LN+5
head -$LNe  <log_file> | tail -10

so drop in "SCSI transport failed" for "<error>" and put your log file in there and it'll rip out 10 lines (5 before and 5 after) around the error.
This User Gave Thanks to Ditto For This Post:
# 3  
Old 12-11-2014
A bit more context would be helpful. Is that a system log file? Is it rotated regularly, so earlier files might be zipped/compressed? Then you need to specify at what point in time your search should start, and take respective action.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error while sudo to instance via bash script

Team , I am trying to sudo to instnace using a shell script .In out put i am getting this error for every line ...I am running this script as root .. sudo su - userid -i db2 "command " Error /etc/profile: shopt: not found how can we overcome this error ? Can someone help on... (1 Reply)
Discussion started by: rocking77
1 Replies

2. Solaris

Getting error while trying to create a Solaris boot instance

I issue the following command to create a boot instance from an active boot instance on solaris 11.1. beadm create -a -d "Oracle x86 64 BIT Solaris SunOS Rel 5.11 Ver 11.1 10/2012 Enable SSH " OraSolBcp I get the following error below;- be_mount_callback: failed to mount dataset... (5 Replies)
Discussion started by: Tenyhwa
5 Replies

3. Shell Programming and Scripting

database instance Error capture

I wrote a script to capture some rows from the DB. However I want to capture the errors if the DB instance is down which usually produces errors like below. What should be my approach to kill script if the DB instance is down: DATABASE ERRORS: Msg 937, Level 14, State 1: Server... (2 Replies)
Discussion started by: moe458
2 Replies

4. HP-UX

ERROR: more than one instance of overloaded function "vprintf" has "C" linkage

Hi people! I've got this own library: -------------------------------------------- Personal.h -------------------------------------------- #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdarg.h> #include <string.h> ... (0 Replies)
Discussion started by: donatoll
0 Replies

5. Shell Programming and Scripting

replace first instance(not first instance in line)

Alright, I think I know what I am doing with sed(which probably means I don't). But I cant figure out how to replace just the first occurance of a string. I have tried sed, ed, and grep but can't seem to figure it out. If you have any suggestions I am open to anything! (3 Replies)
Discussion started by: IronHorse7
3 Replies

6. Solaris

Explorer causing syslog error

Hi there, I have upgraded my explorer (SUNWexplo) on a solaris 10 Sparc box from version 3.4 to the latest version (5.5) . However im a little concerned, whenever I run the new explorer either manually or scheduled, I get a syslog event as follows 1 in 0:08:31: Sep 22 17:00:15 fmy.machine.com... (8 Replies)
Discussion started by: hcclnoodles
8 Replies

7. Shell Programming and Scripting

first instance to end of log file

All, I looking for developing a script which would find the first instance of a date in a log file: 2004/07/15 19:16:09 Here are the next couple lines after the dat time stamp: backup completed daemon started. And I want to put the rest of the lines after the first instance in this... (2 Replies)
Discussion started by: bubba112557
2 Replies

8. UNIX Desktop Questions & Answers

regd explorer

hiii i want to know how to install explorer in sparc e-250 OS solaris 8 iam able to install the software iam able to install the explorer,i use to run #./explorer -q -e other than this what all i should run to get all details.but iam just getting some thing which not related to o/s or h/w... (3 Replies)
Discussion started by: solaris8in
3 Replies

9. UNIX for Advanced & Expert Users

Printer Error(the Object Instance Test Does Not Exist)

Hello, i need some help about how to set up a high velocity impact printer in UNIX SCO 5.05, this printer is attached with a parallel port in a PC(host), the host use tunemul to access unix.(this reference is just to ask you if this is a local or remote connection, just to be sure), so, i... (2 Replies)
Discussion started by: jav_v
2 Replies

10. UNIX for Dummies Questions & Answers

internet explorer for hp-ux

Hello, i'm running a hp-ux workstation model 715 / 100 with hp-ux version 11.11 i need a microsoft internet explorer for this workstation to make some tests. does anyone know where i can cat a internet explorer 4.01 for my workstation? Thank all for help! ;-) (3 Replies)
Discussion started by: ortsvorsteher
3 Replies
Login or Register to Ask a Question