Unique line from logfile


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unique line from logfile
# 1  
Old 09-19-2013
Unique line from logfile

Hi Team,

Pls help me in fixing this problem.

I have file called ORA_FILE.log

Please find the log in that below:
************************

Code:
ORA-04061: existing state of package body "MST.ONE_PACKAGE" has been invalidated
ORA-04065: not executed, altered or dropped package body "MST.ONE_PACKAGE"
ORA-06508: PL/SQL: could not find program unit being called: "MST.ONE_PACKAGE"
ORA-06512: at line 1
ISB-SA-DA:ERROR: dbPoll() SQL Exception: java.sql.SQLException: ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "MST.ONE_PACKAGE" has been invalidated
ORA-04065: not executed, altered or dropped package body "MST.ONE_PACKAGE"
ORA-06508: PL/SQL: could not find program unit being called: "MST.ONE_PACKAGE"
ORA-06512: at line 1

ISB-SA-DA:ERROR: dbPoll() SQL Exception: java.sql.SQLException: ORA-04068: existing state of packages has been discarded
ISB-SA-DA:ERROR: dbPoll() SQL Exception: java.sql.SQLException: ORA-04068: existing state of packages has been discarded
ISB-SA-DA:ERROR: dbPoll() SQL Exception: java.sql.SQLException: ORA-04068: existing state of packages has been discarded


I need to get unique from this logfile to other logfile.

Pls suggest me get the output like this

Thanks in advance,
Regards,
Indu

Last edited by radoulov; 09-19-2013 at 07:40 AM..
# 2  
Old 09-19-2013
Code:
awk '!a[$0]++' ORA_FILE.log > unique_ORA_FILE.log

# 3  
Old 09-19-2013
I'd be interested in a time comparison on the awk solution and the following...sort ORA_FILE.log | uniq>unique_ORA.log
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Search for word in huge logfile and need to continue to print few lines from that line til find date

Guys i need an idea for one logic..in shell scripting am struggling with a logic...So the thing is... i need to search for a word in a huge log file and i need to continue to print few more lines from that line and the consecutive line has to end when it finds the line with date..because i know... (1 Reply)
Discussion started by: Prathi
1 Replies

2. UNIX for Beginners Questions & Answers

Output top line for each unique host

Hi All, Please can you help with the output whole line for each host (column 3) and the top line of column 9 - the lastest only What is being outputted 243272484 3 nbmedln1p03 LDN_TEST_UX_JM 1488198368 0000000007 1 INC_1MTH 0 ********** 243272492 3 nbmedln1p03 LDN_TEST_UX_JM... (10 Replies)
Discussion started by: Junes
10 Replies

3. Shell Programming and Scripting

Logfile monitoring with logfile replacement

Bonjour, I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things. The script use the following technique : tail -fn0 $logfile | \ while read line ; do ... some stuff done First one, I'd like a way to end the monitoring script if a... (3 Replies)
Discussion started by: Warluck
3 Replies

4. UNIX for Dummies Questions & Answers

Print unique lines without sort or unique

I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies

5. Shell Programming and Scripting

Unique words in each line

In each row there could be repetition of a word. I want to delete all repetitions and keep unique occurrences. Example: a+b+c ab+c ab+c abbb+c ab+bbc a+bbbc aaa aaa aaa Output: a+b+c ab+c abbb+c ab+bbc a+bbbc aaa (6 Replies)
Discussion started by: Viernes
6 Replies

6. Shell Programming and Scripting

Combine multiple unique lines from event log text file into one line, use PERL or AWK?

I can't decide if I should use AWK or PERL after pouring over these forums for hours today I decided I'd post something and see if I couldn't get some advice. I've got a text file full of hundreds of events in this format: Record Number : 1 Records in Seq : ... (3 Replies)
Discussion started by: Mayday22
3 Replies

7. Shell Programming and Scripting

Change unique file names into new unique filenames

I have 84 files with the following names splitseqs.1, spliseqs.2 etc. and I want to change the .number to a unique filename. E.g. change splitseqs.1 into splitseqs.7114_1#24 and change spliseqs.2 into splitseqs.7067_2#4 So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies

8. Shell Programming and Scripting

Script to extract line from logfile

Hi , Can someone help me,I am not well versed with scripting,it is very urjent. Need a script in perl or shell for the following task. The logfile contains several entries of which one particular string to be searched and that complete line has to be removed and copied to another file to... (25 Replies)
Discussion started by: garryt21@rediff
25 Replies

9. Shell Programming and Scripting

get part of file with unique & non-unique string

I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM". I can find the line number for the beginning of the statement section with sed. ... (5 Replies)
Discussion started by: andrewsc
5 Replies

10. Shell Programming and Scripting

Logfile - extracting certain lines to concatenate into 1 line

I've got a log file from automatic diagnostic runs. The log file is appended to each time an automatic log is run. I'd like to just pull certain lines from each run in the log file, and concatenate them into 1 comma delimited line (for export into excel or an html table). Each diagnostic run... (3 Replies)
Discussion started by: BecTech
3 Replies
Login or Register to Ask a Question