Sponsored Content
Top Forums Shell Programming and Scripting How to read multiple line from log file Post 302281583 by vishal_vsh1 on Thursday 29th of January 2009 06:29:43 AM
Old 01-29-2009
for example here is some text of log file

2008-11-24 07:25:41,677 INFO (main - txUID5c4os1l-l4zigw-fnwsocop-1-fnwsocoq-2) [ZeroConfRegistry] Starting ZC-Service-Monitor with initalwait=5000 and interval= 5000
2008-11-24 07:25:44,114 INFO (main - txUID5c4os1l-l4zigw-fnwsocop-1-fnwsocoq-2) [Embedded] Catalina naming disabled
2008-12-16 21:29:33,860 ERROR (adPoolWorker[1] - txUID5c4os1l-l4zigw-fnwsocop-1-fnwsx74u-9) [AbstractIndexBuilder] SEARCHE0129 problem rebuilding index
com.lastminute.u2search.index.IndexException: problem reading source
at com.lastminute.u2search.index.tree.stored.StoredTreeIndexBuilder.index(StoredTreeIndexBuilder.java:1 29)
at com.lastminute.u2search.index.tree.stored.StoredTreeIndexBuilder.rebuild(StoredTreeIndexBuilder.java :87)
at com.lastminute.u2search.index.builder.AbstractIndexBuilder.runScheduledTask(AbstractIndexBuilder.jav a:68)
at com.lastminute.u2search.util.Scheduler.runPendingTasks(Scheduler.java:91)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.ObjectSmilieLjava.lang.Object;(Unknown Source)
Caused by: com.lastminute.u2search.source.SourceException: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: No connections are allowed in quiescent mode.); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: No connections are allowed in quiescent mode.))
2008-12-16 21:32:30,943 INFO (adPoolWorker[1] - txUID5c4os1l-l4zigw-fnwsocop-1-fnwsx74u-9) [LocationRelationshipIndexBuilder] SEARCHI0022 at 10 records...


keep on going.......................

So what i want is to grep and ERROR, but if i grep error <file name> then it will display only one line of error.
i want to place a logic so that starting from line ERROR until INFO i was all the lines.. like

2008-12-16 21:29:33,860 ERROR (adPoolWorker[1] - txUID5c4os1l-l4zigw-fnwsocop-1-fnwsx74u-9) [AbstractIndexBuilder] SEARCHE0129 problem rebuilding index
com.lastminute.u2search.index.IndexException: problem reading source
at com.lastminute.u2search.index.tree.stored.StoredTreeIndexBuilder.index(StoredTreeIndexBuilder.java:1 29)
at com.lastminute.u2search.index.tree.stored.StoredTreeIndexBuilder.rebuild(StoredTreeIndexBuilder.java :87)
at com.lastminute.u2search.index.builder.AbstractIndexBuilder.runScheduledTask(AbstractIndexBuilder.jav a:68)
at com.lastminute.u2search.util.Scheduler.runPendingTasks(Scheduler.java:91)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.ObjectSmilieLjava.lang.Object;(Unknown Source)
Caused by: com.lastminute.u2search.source.SourceException: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: No connections are allowed in quiescent mode.); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: No connections are allowed in quiescent mode.))



I hope i am clear now.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to read a line in gps receiver log file and append that line to new file

Hi, I have gps receiver log..its giving readings .like below Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GPSD,R=1 $GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies

2. Shell Programming and Scripting

Read multiple log files and create output file and put the result

OS : Linux 2.6.9-67 - Red Hat Enterprise Linux ES release 4 Looking for a script that reads the following log files that gets generated everynight between 2 - 5am Master_App_20090717.log Master_App1_20090717.log Master_App2_20090717.log Master_App3_20090717.log... (2 Replies)
Discussion started by: aavam
2 Replies

3. Shell Programming and Scripting

bash: read file line by line (lines have '\0') - not full line has read???

I am using the while-loop to read a file. The file has lines with null-terminated strings (words, actually.) What I have by that reading - just a first word up to '\0'! I need to have whole string up to 'new line' - (LF, 10#10, 16#A) What I am doing wrong? #make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies

4. Shell Programming and Scripting

Read 1-line file and separate into multiple variables

I have one line files with 17 records separated by a semi-colon. I need to create a variable from each record, which I can do via a separate awk for each one, but I know there has to be a better way. Along with pulling out the variable, I need to convert some url coding like a + to a space, etc.... (4 Replies)
Discussion started by: numele
4 Replies

5. Shell Programming and Scripting

read one line file and separate into multiple lines

I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field. example input line: ... (2 Replies)
Discussion started by: erlanq
2 Replies

6. Shell Programming and Scripting

read one line file and separate into multiple lines

I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field. example input line: ... (1 Reply)
Discussion started by: erlanq
1 Replies

7. Shell Programming and Scripting

Shell script to read multiple options from file, line by line

Hi all I have spent half a day trying to create a shell script which reads a configuration file on a line by line basis. The idea of the file is that each will contain server information, such as IP address and various port numbers. The line could also be blank (The file is user created). Here... (1 Reply)
Discussion started by: haggismn
1 Replies

8. Shell Programming and Scripting

HELP: Shell Script to read a Log file line by line and extract Info based on KEYWORDS matching

I have a LOG file which looks like this Import started at: Mon Jul 23 02:13:01 EDT 2012 Initialization completed in 2.146 seconds. -------------------------------------------------------------------------------- -- Import summary for Import item: PolicyInformation... (8 Replies)
Discussion started by: biztank
8 Replies

9. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

10. UNIX for Dummies Questions & Answers

Read in Multiple log files and output selected variables and values to cvs file

I have several problems with my problems: I hope you can help me. 1) the If else statement I am getting an error message. My syntax must be incorrect because the entire statement is throwing an error. For example in filew.log if these items don't exist Memsize, SASFoundation and also if... (0 Replies)
Discussion started by: dellanicholson
0 Replies
ABRT-ACTION-ANALYZ(1)						    ABRT Manual 					     ABRT-ACTION-ANALYZ(1)

NAME
abrt-action-analyze-java - Calculate and save UUID & DUPHASH and determine the level of usability for reporting of a Java stack trace. SYNOPSIS
abrt-action-analyze-java [-v] [-d DIR] [-o] [-f FILE] DESCRIPTION
The tool reads the file named backtrace from a problem data directory, processes it and generates a universally unique identifier (UUID). Then it saves this data as new element uuid. It also checks whether the stack trace contains a remote address in any of its frames and if so it creates not-reportable element whose contents explains why the stack trace should not be reported into a bug tracking system. Integration with ABRT events abrt-action-analyze-java can be used to generate the UUID & DUPHAS of a newly saved Java stack trace. EVENT=post-create analyzer=Java abrt-action-analyze-java OPTIONS
-d DIR Path to a problem directory. The tool reads the backtrace from stdin when neither this option nor -f is provided. -f FILE Path to a stack trace. The tool reads the backtrace from stdin when neither this option nor -d is provided. -o Print the result to stdout. -v Be more verbose. Can be given multiple times. AUTHORS
o ABRT team abrt-java-connector 01/19/2014 ABRT-ACTION-ANALYZ(1)
All times are GMT -4. The time now is 02:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy