conversekid
asked on
to grep log files
Hi, I am using egrep to grep for a particlular date in a log file. However I am getting only first line.
Example in the log below, When I egrep for Nov 12, 2008 I am getting only the first line, but I require all the lines following that. Is there any way by which we can do that.
<Nov 12, 2008 11:03:06 PM EST> <Error> <HTTP> <BEA-101214> <Included resource or file "/motoconfig/gomez_bd_head er.html" not found from requested resource "/m
otoconfig/gomez.jsp".>
Size of Env:36
ModeId:1
Host:172.20.79.109
Domain:mphasis
ModeId:1
Host:FL08-4492
Domain:comm.mot.com
ModeId:1
Host:mlbp-0090
Domain:mphasis
ModeId:1
Host:mlbp-0101
Domain:mphasis
ModeId:1
Host:172.20.79.74
Domain:mphasis
ModeId:1
Host:MLBP-0097
Domain:MPHASIS.COM
ModeId:1
Host:mjie-0003
Domain:mphasis
ModeId:1
Host:plsu014
Example in the log below, When I egrep for Nov 12, 2008 I am getting only the first line, but I require all the lines following that. Is there any way by which we can do that.
<Nov 12, 2008 11:03:06 PM EST> <Error> <HTTP> <BEA-101214> <Included resource or file "/motoconfig/gomez_bd_head
otoconfig/gomez.jsp".>
Size of Env:36
ModeId:1
Host:172.20.79.109
Domain:mphasis
ModeId:1
Host:FL08-4492
Domain:comm.mot.com
ModeId:1
Host:mlbp-0090
Domain:mphasis
ModeId:1
Host:mlbp-0101
Domain:mphasis
ModeId:1
Host:172.20.79.74
Domain:mphasis
ModeId:1
Host:MLBP-0097
Domain:MPHASIS.COM
ModeId:1
Host:mjie-0003
Domain:mphasis
ModeId:1
Host:plsu014
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi, omarfarid:
It will give that line..but we require few lines until the date changes again..For example if I am searching for a particular date I want all the lines until the date changes
It will give that line..but we require few lines until the date changes again..For example if I am searching for a particular date I want all the lines until the date changes
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
pls find out.txt as attachmet for log file..
egrep "Nov 12, 2008 |11/12" motoconfig1.out is the command I am using
I am getting output like this:
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <User object is null. Creating anonymous repository.>
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <Total menu Items: 1>
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <Menu Id: 33>
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <Menu Name: Home>
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <Parent menu name: null>
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <Parent menu id: -1>
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <Description: MOTOCONFIG Tool - Home - $$HOME_PAGE$$>
<Nov 12, 2008 12:53:07 AM EST> <Debug> <iDen> <000000> <Location: /motoconfig/Home.do>
<Nov 12, 2008 12:53:07 AM EST> <Error> <HTTP> <BEA-101214> <Included resource or file "/motoconfig/gomez_bd_head
<Nov 12, 2008 12:53:07 AM EST> <Error> <HTTP> <BEA-101214> <Included resource or file "/motoconfig/gomez_bd_foot
[11/12 00:53:07.112 AM] jsp_servlet.__gomez _jspService GOMEZ - Time (ms) To Do A JSP Include To The Login Page: 34
[11/12 00:53:07.113 AM] jsp_servlet.__gomez _jspService GOMEZ - Total Test Time (ms) Observed From App. Side: 53
[11/12 00:53:07.113 AM] jsp_servlet.__gomez _jspService GOMEZ -
[11/12 00:53:22.576 AM] jsp_servlet.__gomez _jspService GOMEZ -
[11/12 00:53:22.583 AM] jsp_servlet.__gomez _jspService GOMEZ - Time (ms) To Get 9iRAC Connection: 7
[11/12 0
out.txt