search a logfile for strings


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers search a logfile for strings
# 1  
Old 11-25-2007
Data search a logfile for strings

Hi experts..

I am trying to write a shell script which will scan a log file for three strings ie success image1, success image2, success image3.
My shell is tcsh

If all the 3 strings are found then insert the 3 strings to a file1 and send mail to developers with file1

If all 3 are note found copy the strings to a file2 and send file2 to developers.

Similarly, if string image1 & image2 are found and image3 missing...then insert the string image1 & image2 to file-1 and insert the string image3 to file-2 and send a mail attaching both file1 & file2 to developer.

I tried if - else but that is making the scrip longer,

Could anyone please tell me different way (ideally,using fgrep\grep\sed\awk..or other)

Thanks

AmitSmilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Search for word in huge logfile and need to continue to print few lines from that line til find date

Guys i need an idea for one logic..in shell scripting am struggling with a logic...So the thing is... i need to search for a word in a huge log file and i need to continue to print few more lines from that line and the consecutive line has to end when it finds the line with date..because i know... (1 Reply)
Discussion started by: Prathi
1 Replies

2. UNIX for Dummies Questions & Answers

Search specific string logfile specific date range

Hi, I have logfile like this.. === 2014-02-09 15:46:59,936 INFO RequestContext - URL: '/eyisp/sc/skins/EY/images/pickers/comboBoxPicker_Over.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko': Unsupported with Accept-Encoding header === 2015-02-09... (8 Replies)
Discussion started by: kishk
8 Replies

3. Shell Programming and Scripting

Logfile monitoring with logfile replacement

Bonjour, I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things. The script use the following technique : tail -fn0 $logfile | \ while read line ; do ... some stuff done First one, I'd like a way to end the monitoring script if a... (3 Replies)
Discussion started by: Warluck
3 Replies

4. Shell Programming and Scripting

Search pattern on logfile and search for day/dates and skip duplicate lines if any

Hi, I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error. Unfortunately, this is not a fool proof script.... (2 Replies)
Discussion started by: newbie_01
2 Replies

5. Shell Programming and Scripting

Search between two search strings and print the value

Based on the forums i have tried with grep command but i am unable to get the required output. search this value /*------ If that is found then search for temp_vul and print and also search until /*------- and print new_vul Input file contains: ... (5 Replies)
Discussion started by: onesuri
5 Replies

6. Shell Programming and Scripting

Search between 2 strings

Guys any pointers on how to search between 2 sets date strings with time in the below file example :- 02-Feb-2010 23:12:09 GMT event_type::event_details_are_like_this 02-Feb-2010 09:10:29 GMT event_type::event_details_are_like_this 03-Feb-2010 11:12:19 GMT... (3 Replies)
Discussion started by: lavascript
3 Replies

7. Shell Programming and Scripting

how to search with 2 strings.

Hi, i have a file a.txt like -------------------------------- col1|col2|col3 data1|data2|data3 other1|other2|other3 -------------------------------- i need to search 2 strings(data in a.txt file is case sesnsitive), suppose data1 and data2. If these 2 strings found then only i need... (2 Replies)
Discussion started by: syamkp
2 Replies

8. Shell Programming and Scripting

Search between strings with an OR

Hi have Input in this way KEY AAAA BBBB END1 KEY AAAA BBBB END2 KEY AAAA BBBB END3 I need to find any thing matching in between KEY And ending with "END1|END2|END3" This didnot work awk '/KEY/,/END1|END2|END3/' (3 Replies)
Discussion started by: pbsrinivas
3 Replies

9. UNIX for Dummies Questions & Answers

Can and How to mark search strings within VI?

Hi all, When in 'less' or '-' or whatever your alias is, if you search for a string, you get all of it's occurences highlighted. Is there any option I can set in VI, .exrc or whtever, to have the same behaviour in VI? thanks (2 Replies)
Discussion started by: sierra_aar
2 Replies

10. UNIX for Dummies Questions & Answers

Search for strings

I am trying to replace the word ACTIVE with 2002 in a file and I am getting the following error. Does anyone know what this means? $ sed "s/ACTIVE/2002" mydata.txt > yourdata.txt sed: 0602-404 Function s/ACTIVE/2002 cannot be parsed. (5 Replies)
Discussion started by: lesstjm
5 Replies
Login or Register to Ask a Question
LIGHT_CORRECT(1)					      General Commands Manual						  LIGHT_CORRECT(1)

NAME
light_correct - correct illumination errors on set of images SYNOPSIS
light_correct grey image1 image2 image3 ... DESCRIPTION
The first argument should be an image of a piece of grey card, subsequent arguments should be images taken with the same lighting set-up which need correcting. The corrected images are written to files prefixed with "ic_". For example, suppose you have a directory with the following files in: example% ls dat1.1.v dat1.2.v dat2.1.v dat2.2.v dat3.1.v dat3.2.v dat4.1.v dat4.2.v grey.v then run light_correct like this: example% light_correct grey.v dat*.v to generate this: example% ls dat1.1.v dat1.2.v dat2.1.v dat2.2.v dat3.1.v dat3.2.v dat4.1.v dat4.2.v grey.v ic_dat1.1.v ic_dat1.2.v ic_dat2.1.v ic_dat2.2.v ic_dat3.1.v ic_dat3.2.v ic_dat4.1.v ic_dat4.2.v light_correct works by smoothing out the grey card image, finding grey-mean/pixel for each point, and then multiplying the result by all the following images. It also removes any .desc files it generates, to avoid problems with im_global_balance(3). RETURN VALUE
returns 0 on success and non-zero on error. SEE ALSO
header(1), vips(1) COPYRIGHT
The National Gallery and Birkbeck College, 1989-1996. 14 Oct 1996 LIGHT_CORRECT(1)