Command needed to Parse Catalina.out in Linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Command needed to Parse Catalina.out in Linux
# 1  
Old 05-24-2009
Data Command needed to Parse Catalina.out in Linux

Hi all,

Everyday I used to parse the Catalina.out log file on my Redhat system for errors for a particular date. Could anybody be able to help me to create a command which can grep the contents of Catalina.out starting from particular date.
Please do not suggest command which greps only the lines with that date, I mean I need all the lines starting from that particular date.

Thanks,
RedHatPerl
# 2  
Old 05-24-2009
show a sample of that file. and what you want to get.
# 3  
Old 05-25-2009
Here is the sample what I want.... see my Catalina.out logs below, here I want to grep all the lines which start from date May 25, 2009. upto the end but I need all the lines which comes in between, otherwise I could have used this :

grep "May 25" catalina.out

But it only gives me the lines with May 25, I need all the lines starting from date May 25 to the end of May 25.

[xxx@hub tomcat]$cat catalina.out
May 24, 2009 7:30:22 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/Java/1.5.0_12/jre/lib/i386/client:/opt/Java/1.5.0_12/jre/lib/i386:/opt/Java/1.5.0_12/jre/../lib/i386
May 24, 2009 7:30:22 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
May 24, 2009 7:30:22 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 762 ms
May 24, 2009 7:30:23 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 24, 2009 7:30:23 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.13
May 24, 2009 7:30:24 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/opt/Tomcat/Tomcat_Base/webapps/xfire/WEB-INF/lib/javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
May 24, 2009 7:30:25 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
May 24, 2009 7:30:25 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
May 25, 2009 1:30:25 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/27 config=null
May 25, 2009 1:30:25 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2301 ms
License file saxon-license.lic not found. Running in non-schema-aware mode
# 4  
Old 05-25-2009
so the output you want is
May 25, 2009 1:30:25 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/27 config=null
May 25, 2009 1:30:25 AM org.apache.catalina.startup.Catalina start

right? try to describe the output you want clearly.
# 5  
Old 05-25-2009
Yes you are right .. output I want is all the logs of date 25th May..
# 6  
Old 05-25-2009
Quote:
Originally Posted by redhatperl
Yes you are right .. output I want is all the logs of date 25th May..
then how about the last 2 lines ?

INFO: Server startup in 2301 ms
License file saxon-license.lic not found. Running in non-schema-aware mode

they are part of the last "May 25" right?
# 7  
Old 05-25-2009
Yes these all lines are part of "May 25"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script parse file Linux

Hi all, I need help for a script that pulls out a series of numbers from a file (attached file) Basically I need a parse to write me in a variable: 9d424312 Can someone help me? Thank you (2 Replies)
Discussion started by: gianvitolinuxs
2 Replies

2. Shell Programming and Scripting

Linux command needed

guys im new here and i need help with some linux commands. filea has keyword on each line identity aaa bbb ccc i have following commands. egrep 'www.identity' ~/home/m3 >~/home/lopo2 wc -l file ~/home/lopo2 say lopo2 has 44 lines then output saved is identity 44 (1 Reply)
Discussion started by: ahfze
1 Replies

3. Solaris

Need command to parse data

Hi Friends, I have data like below t064266 I want output into this format t064266 Data are space delimited and i want parse third column data. Thanks (9 Replies)
Discussion started by: Jagaat
9 Replies

4. UNIX for Advanced & Expert Users

Command help needed in linux flavour OS

HI, My requirement as below Log with Error Starting FeedRunner for feed: 200 Product example Items Error FeedRunner for feed: 200 Product example Items Stopping FeedRunner for feed : 200 Product example Items Feed time taken 231743 Log without Error Starting... (0 Replies)
Discussion started by: Paulwintech
0 Replies

5. Shell Programming and Scripting

Command needed in linux flavour OS

HI, My requirement as below Log with Error Code: Starting FeedRunner for feed: 200 Product example Items Error FeedRunner for feed: 200 Product example Items Stopping FeedRunner for feed : 200 Product example Items Feed time taken 231743 Log without Error Code: ... (0 Replies)
Discussion started by: Paulwintech
0 Replies

6. Solaris

Log Rotation of Catalina.out

Hi, Recently i received a request to rotate logs of catalina.out (tomcat). The file size was about 807 MB. I used logadm to truncate the log ( -c ) and zip (-z 0) it. Everything worked fine, catalina.out.0.gz was created (22 MB) and the size of original catalina.out became 0kb. After... (2 Replies)
Discussion started by: Mack1982
2 Replies

7. Shell Programming and Scripting

Parse variable into a command

What I am trying to do is write a script that makes some commands easier, now one of the commands is to rebuild mail boxes in plesk, which would would be something like /usr/loca/psa/websrvmng --vhost-reconfigure --vhost-name=domain.com but the domain.com bit is going to need to change with... (3 Replies)
Discussion started by: foz
3 Replies

8. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

9. Shell Programming and Scripting

Shell Script Needed to Parse Results

Raw Results: results|192.168.2|192.168.2.1|general/udp|10287|Security Note|For your information, here is the traceroute from 192.168.2.24 to 192.168.2.1 : \n192.168.2.24\n192.168.2.1\n\n results|192.168.2|192.168.2.1|ssh (22/tcp)|22964|Security Note|An SSH server is running on this port.\n... (2 Replies)
Discussion started by: jroberson
2 Replies

10. Solaris

Catalina Analysis

How can I make analysis for catalina.out (2 Replies)
Discussion started by: Burhan
2 Replies
Login or Register to Ask a Question