Unix log treatment


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix log treatment
# 1  
Old 03-02-2004
Unix log treatment

Hello,

I need your help for a Unix log treatment.

I have a file log of this type:

MEGALOG2.LOG :

Quote:
----- amqrccca.c : 804 --------------------------------------------------------
02/24/04 02:51:54
AMQ7467: The oldest log file required to start queue manager XXXX is
S0000010.LOG.
EXPLANATION:
The log file S0000010.LOG contains the oldest log record required to restart
the queue manager. Log records older than this may be required for media
recovery.
ACTION:
You can move log files older than S0000010.LOG to an archive medium to release
space in the log directory. If you move any of the log files required to
recreate objects from their media images, you will have to restore them to
recreate the objects.
-------------------------------------------------------------------------------
02/24/04 02:53:04
AMQ9002: Channel program started.
The log file S0000010.LOG contains the oldest log record required to recreate
EXPLANATION:bjects from their media images. Any log files prior to this will
Channel program 'XXXX.YYYYYYYY' started.ions.
ACTION:
None.
-------------------------------------------------------------------------------
02/24/04 02:54:19
AMQ9213: A communications error for TCP/IP occurred.

EXPLANATION:
An unexpected error occurred in communications.
ACTION:
ACTION:
Look at previous error messages for channel program 'XXXX.YYYYYYYY' in the
error files to determine the cause of the failure.
---------------------------------- amqrccca.c : 804 --------------------------------------------------------
02/24/04 03:03:04
AMQ9002: Channel program started.
EXPLANATION:
EXPLANATION:ram 'XXXX.YYYYYYYY' ended abnormally.
Channel program 'XXXX.YYYYYYYY' started.
ACTION:
None.
----- amqrccca.c : 804 --------------------------------------------------------
02/24/04 03:33:04
AMQ9002: Channel program started.

EXPLANATION:
An unexpected error occurred in communications.
ACTION:
The return code from the TCP/IP (connect) call was 81 (X'51'). Record these
values and tell the systems administrator
------------------------------------------ amqccita.c : 994 --------------------------------------------------------
02/24/04 03:34:19
AMQ9999: Channel program ended abnormally.
EXPLANATION:
EXPLANATION:
Channel program 'XXXX.YYYYYYYY' ended abnormally.
ACTION:
Look at previous error messages for channel program 'XXXX.YYYYYYYY' in the
error files to determine the cause of the failure.

And I would like to have the same log in this format:


Quote:
02/24/04 02:51:54 AMQ7467: The oldest log file required to start queue manager XXXX is S0000010.LOG.
02/24/04 02:53:04 AMQ9002: Channel program started. The log file S0000010.LOG contains the oldest log record required to recreate
02/24/04 02:54:19 AMQ9213: A communications error for TCP/IP occurred.
02/24/04 03:03:04 AMQ9002: Channel program started.
02/24/04 03:34:19 AMQ9999: Channel program ended abnormally.
In fact, for each entry log, I would just have on a single line: the date, the hour, the ID error and just the first text, I want to delete all text that is behind EXPLANATION

I can put the entire entry log on only one line with this command:

Quote:
sed s/^--*?*-*/CHANGEMENT/ ./errors/MEGALOG2.LOG |awk '{if ($1 != "CHANGEMENT")
{printf $0} else { printf "\n"}}' > analyse.log

But I don't know how to eliminate all which is behind EXPLANATION.

I hope that is clear for you.
Smilie
Thx for your answers.
# 2  
Old 03-02-2004
.....

Last edited by druuna; 05-21-2009 at 10:15 AM..
druuna
# 3  
Old 03-03-2004
thank you very much for your answer Smilie
my problem is resolved.

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix Log out time

Hi, Is there a way to find out the logout date for a user who has been logged in to the system for more than 1 day. For example, the below user as indicated by the "last" command had logged into the system on Mar 8 and he has been online for 2 days and 6:53 hour:min. So basically, he logged out... (2 Replies)
Discussion started by: devtakh
2 Replies

2. UNIX for Dummies Questions & Answers

unix log files

The unix admins in work have forced us to use a custom restricted shell on one of our servers.From what i can tell, this shell tags log messages (using /usr/bin/logger) with various info (date, hostname, user, connection info, etc...). It also forces the execution of commands through ksh.I've not... (2 Replies)
Discussion started by: Irrational
2 Replies

3. Shell Programming and Scripting

Error in multiple files treatment with AWK

Hello, My code is like that: awk -v f=92238 '$1~/^m2/{tok1=1;next}tok1==1&&$0~f{tok1=0;print $NF}' inp. inp.1 Eahc of the "inp.*" file is like that: ... m1 xxxx xxxx 92238 897987 xxxx xxxx m2 xxxx xxxx 92238 123435 xxxx xxxx ... (1 Reply)
Discussion started by: jolecanard
1 Replies

4. UNIX for Advanced & Expert Users

unix log file

Hi I want to know where the unix log file is stored I couldnt fınd anythıng under var/log directory Regards (8 Replies)
Discussion started by: tjay83
8 Replies

5. Shell Programming and Scripting

alert_oss.log oracle log file in hp-unix

Hi I have go this alert_oss.log that is basically capturing all the oracle errorlogs.Now the problem is that it is one huge file and to see log of some particular date i tried cat alert_oss.log | grep 'Mar 25 10:44:45 2007' > alert_25.txt is not giving me the required output. pls suggest ... (3 Replies)
Discussion started by: Assassin
3 Replies

6. Shell Programming and Scripting

Log of the Unix script

Hi, I have written a Unix shell script that does different things like copying the files from location to another etc depending on various conditions. There are print statements in the script. The problem is I want the script to log the activity in a file right from the moment the script... (1 Reply)
Discussion started by: srinik20
1 Replies

7. UNIX for Dummies Questions & Answers

Cannot Log-in Unix Server

I an receiving an error message when logging in as root the message is "out of inodes on EAFS dev hd 1/40 -- I cannot get in at all can someone help - we are shut down (2 Replies)
Discussion started by: Bev
2 Replies

8. Cybersecurity

UNIX error log

A system administration utility has recently been installed at the SCO Openserver (UNIX) servers of our bank. While receiving the error log files of this utility, we have noted the following warning messages: <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> · ... (3 Replies)
Discussion started by: eysheikah
3 Replies

9. Cybersecurity

UNIX error log

system administration utility has recently been installed at the SCO Openserver (UNIX) servers of our bank. While receiving the error log files of this utility, we have noted the following warning messages: <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> · ... (0 Replies)
Discussion started by: eysheikah
0 Replies
Login or Register to Ask a Question