smart search through find command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting smart search through find command
# 1  
Old 04-08-2011
smart search through find command

The requirement here is i'm searching for a particular word from the log file between two time stamp.

The process for particular account will happen, so i need to see there is any error occurred in between before it completes. in the below code yyyyy and xxxxx are two unique fields. initially i'll search for particular account id and will get this thread and will also search for the success command through this thread and account id. but error may occur in between even though it completes successfully. i can get the start time and end time and i need to search whether this exception has occurred in between or not.

The problem here why i cant grep for the word is after this thread completes the process for one account it can also process another seller. so searching the entire file through the "exception" keyword might result in wrong analysis.

so i need to search this exception has occurred for each seller or not and that to within the particular process alone. so search should be done within the start and end of the process.

i feel find command may be used. or is there any better way or code?

Code:
2011-03-30 05:21:23,875 [yyyyyyy]   WARN  [M: ] c.s.o.m.s.b.seller.export.SellerExportService   :: export failed: javax.xml.stream.XMLStreamException: javax.xml.stream.XMLStreamException: ClientAbortException:  java.net.SocketException: Broken pipe
2011-03-30 05:21:23,875 [xxxxxxxxx]   WARN  [M: ] c.s.o.m.s.b.seller.export.SellerExportService   :: export failed: javax.xml.stream.XMLStreamException: javax.xml.stream.XMLStreamException: ClientAbortException:  java.net.SocketException: Broken pipe

# 2  
Old 04-08-2011
The find command searches for files, it doesn't search inside files.

---------- Post updated at 08:56 AM ---------- Previous update was at 08:54 AM ----------

I don't see anything about the seller in that line, so I don't know how you could expect anything to tell them apart without more information. Are there more lines of context that could help?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple search options in find command

Hi, I'd like find multiple file options to fetch different types of files. find /path...// -type f -name "*.log" -o -name "*.req" -o -name "*.txt" -mtime +5 -exec ls -l {} \; Where as in the above command only the last .txt files its retriving but not .log and .req files can body help... (1 Reply)
Discussion started by: Y.balakrishna
1 Replies

2. UNIX for Dummies Questions & Answers

Help needed - find command for recursive search

Hi All I have a requirement to find the file that are most latest to be modified in each directory. Can somebody help with the command please? E.g of the problem. The directory A is having sub directory which are having subdirectory an so on. I need a command which will find the... (2 Replies)
Discussion started by: sudeep.id
2 Replies

3. Linux

Search only text files with 'find' command?

I've been using this to search an entire directory recursively for a specific phrase in my code (html, css, php, javascript, etc.): find dir_name -type f -exec grep -l "phrase" {} \; The problem is that it searches ALL files in the directory 'dir_name', even binary ones such as large JPEG... (2 Replies)
Discussion started by: Collider
2 Replies

4. UNIX for Advanced & Expert Users

smart command history ?

Hi All. I am learning how to use command history in UNIX, and I got a basic question. Suppose I am in a "verylongpath" directory and I type "gedit thisfile". At a later stage, the command is accessible from the hystory, but it is useless if I have moved to another directory. The same... (1 Reply)
Discussion started by: bruno69
1 Replies

5. UNIX for Dummies Questions & Answers

Explain the difference between the commands cd ~smart and cd ~/smart

Is it possible for both commands to work? (1 Reply)
Discussion started by: phunkypants
1 Replies

6. UNIX for Dummies Questions & Answers

Using find command for timestamp based search

Hi, I am writing a script where i need to list all the files that have a scecific timestamp. I get this time stamp from another file. Is it possible to do this with 'find' command? Please let me know your valuable inputs. Thanks Sunny. (1 Reply)
Discussion started by: sunny_03
1 Replies

7. UNIX for Dummies Questions & Answers

String search - Command to find second occurance

Hi, I am new to Unix world. Is there any command which can directly return the second occurance of a particular string in a file? Basically, I want to read the contents of the file from the second occurance of a particualr string. Can be implemented using a loop, but am just wondering if there... (5 Replies)
Discussion started by: saurabhsinha23
5 Replies

8. UNIX for Dummies Questions & Answers

Search / Find / grep command ...

Is there any command, so I can retrieve all the records in a file from the first occurance of a search string, within that file? (4 Replies)
Discussion started by: videsh77
4 Replies

9. UNIX for Dummies Questions & Answers

search for hardlinks based on filename via find command

I am using command substitution into a find command in a script where I have built a menu to do a bunch of tasks within my unix account. When I choose the options for to find a file/files that have the same inode of the entered filename, ie hardlinks, nothing shows up. When I choose the appropiate... (2 Replies)
Discussion started by: hunternjb
2 Replies
Login or Register to Ask a Question