Using putty to retrieve an XML log



I have to parse a very large log file and I want to use the command grep (or any other tool).


I want to search for each log line for a specific string (let's call it AWB) and display (and possibly save) the related log file.


The log files begins and ends with a date ex (AWB = 93215706) :



20 Nov 2014 14:01:02 com.addval....
...
<RequestOptions/>
...
<AwbId>
<Number>93215706</Number>
</AwbId>
...
</RequestContent>
...
20 Nov 2014 14:01:02 com.addval


Each log I am interested into has the same structure.


So What I am looking to do is to search for this specific number and display (or preferably save on a text file) all the text between the two dates (here 20 Nov 2014).


Do you know what set of Command I should use ?


Thanks a lot


No comments:

Post a Comment