08-17-2011
Hi
Please find the exact logs below
logs:
29-Jul-2011 08:48:22,653 GMT Static data requires update
serverID=fxValue,CancelTimestamp=0,createdTimestamp=1311925697809,lastUpdatedBy=null,revision=0]
Location=London,Name=IBM London Operation Vincenzo Maini,cancelReason=null,ndf=false,
29-Jul-2011 08:48:23,653 GMT Static data requires update
serverID=fxValue,CancelTimestamp=0,createdTimestamp=6311925697809,lastUpdatedBy=null,revision=0]
Location=London,Name=IBM London Operation Vincenzo Maini,cancelReason=null,ndf=false,
createdByUserId=sam@gmail.com
------------------------
-------------------------
-------------------------
-------------------------
29-Jul-2011 08:48:24,653 serverID=fxValue,CancelTimestamp=0,createdTimestamp=8311925697809, lastUpdatedBy=null,revision=0] Location=London,Name=IBM London Operation Vincenzo Ludovico Maini,cancelReason=null,ndf=false,book=LEMFXAUT, createdByUserId=sam@gmail.com
In the above logs my search pattern will be 08:48:22 and UserId=sam@gmail.com
---------- Post updated 08-17-11 at 03:05 PM ---------- Previous update was 08-16-11 at 04:38 PM ----------
Hi All,
I finally got the logic by reading few older posts in this site
really this site is very helpful for the beginners like me
Here is working logic
awk '
BEGIN { start=0; skip=0; }
{
if(index($0, "08:48:22")> 0)
{start=1; print $0}
else
if(index($0, "sam@gmail.com")> 0) { if(skip==0) skip=1; else {skip=0; start=0; print$0 }}
else
if(start==1)
{
print $0
}
} ' log
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
How can i delete the second and subsequent occurrence of a particular string from a file ?
eg) test.txt
cattle
bat
battle
mat
matter
cattle
cattle
my output file should be
cattle
bat
battle
mat
matter (12 Replies)
Discussion started by: gopskrish
12 Replies
2. Shell Programming and Scripting
Hi
I am new shell scripting, i need help on the follwoing
I have a application log file, the application is called on cron, the log includes a "started" and "finished" lines repeatedly. I need to get the log of the for the latest run of the application.
Sample log file
Started
adfa
fadfa... (8 Replies)
Discussion started by: rvz
8 Replies
3. Shell Programming and Scripting
Hi,
Here is a sample of my Test File
$ cat TestFile1
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID MONITORING;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID STORAGE ( NEXT 3464K );
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID
MOVE LOB... (16 Replies)
Discussion started by: rajan_san
16 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
1. I have a file that is getting continously refreshed (appended)
I want to grep all the strings containing substring of the type
abcdf123@aaa.xxx.yyy.zzz:portnumber:
where,
before @, any letters or numbers combination,
after @, IP address
then symbol :
then port... (4 Replies)
Discussion started by: kokoras
4 Replies
5. Shell Programming and Scripting
Thanks for the help yesterday. I have a little modification today,
I am trying the following:
i have a log file of a webbap which logs in the following pattern:
2011-08-14 21:10:04,535 blablabla ERROR Exception1 blablabla
bla
bla
bla
bla
2011-08-14... (2 Replies)
Discussion started by: ppolianidis
2 Replies
6. Shell Programming and Scripting
Guys,
I am trying the following:
i have a log file of a webbap which logs in the following pattern:
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
bla
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
... (6 Replies)
Discussion started by: ppolianidis
6 Replies
7. Shell Programming and Scripting
Hello, I'm looking for sed solution to change
...
<li>keyword</li>
<li>keyword
<li>keyword</li>
<li>keyword
<li>keyword</li>
...
to
...
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
...
I.e., if lines beginning with <li> do not end with... (3 Replies)
Discussion started by: pioavi
3 Replies
8. Shell Programming and Scripting
Hi experts,
I need a help in extracting a set of patterns from the text file.
Below is my scenario.
Input file:
I need to extract the data between
My output should be as
Thanks,
Kalai (7 Replies)
Discussion started by: kalpeer
7 Replies
9. Shell Programming and Scripting
Hi,
I want to add a text to the end of the specific line in a file. Now my file looks like this:
999
111
222
333
111
444
I want to add the string " 555" to the end of the first line contaning 111. Moreover, I want to insert a newline after this line containg the "000" string. The... (8 Replies)
Discussion started by: wenclu
8 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies