Format output of errpt


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Format output of errpt
# 1  
Old 05-24-2009
Format output of errpt

When i use the errpt command, i just want to see the timestamp and description only. How do i filter this out.

errpt |awk '{print $2,$6}'

The above commnad works but the description field becomes truncated.

The result for the above command as below

TIMESTAMP DESCRIPTION
0524143109 OPERATOR
0524143109 OPERATOR
0524143109 OPERATOR

The description should actually show operator notification....but thats missing. Since the description can very in length depending on the messages, how do i format it to show the entire length.
# 2  
Old 05-24-2009
Can you paste the o/p of the errpt command? And your expected formatted o/p
# 3  
Old 05-24-2009
How about:
Code:
errpt |awk '{print $2,$6" "$7}'

?
# 4  
Old 05-24-2009
Quote:
Originally Posted by devtakh
Can you paste the o/p of the errpt command? And your expected formatted o/p
For your ref O/P looks like this Smilie
Code:
 
IDENTIFIER TIMESTAMP  T C RESOURCE_NAME  DESCRIPTION
C69F5C9B   0514104409 P S SYSPROC        SOFTWARE PROGRAM ABNORMALLY TERMINATED
C69F5C9B   0512233909 P S SYSPROC        SOFTWARE PROGRAM ABNORMALLY TERMINATED
C69F5C9B   0510234109 P S SYSPROC        SOFTWARE PROGRAM ABNORMALLY TERMINATED
3A30359F   0427232709 T S init           SOFTWARE PROGRAM ERROR
C69F5C9B   0424233509 P S SYSPROC        SOFTWARE PROGRAM ABNORMALLY TERMINATED

# 5  
Old 05-24-2009
This is what i get when i just type errpt

smon2:root:/=> errpt
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
AA8AB241 0524143109 T O OPERATOR OPERATOR NOTIFICATION
AA8AB241 0524143109 T O OPERATOR OPERATOR NOTIFICATION
AA8AB241 0524143109 T O OPERATOR OPERATOR NOTIFICATION
smon2:root:/=>


This is what i get when i use the below command instead

smon2:root:/=> errpt | awk '{print $2,$6}'
TIMESTAMP DESCRIPTION
0524143109 OPERATOR
0524143109 OPERATOR
0524143109 OPERATOR
smon2:root:/=>


What i am trying to do is to get errpt to just output the Timestamp and the description only. But as you can see above, it only shows operator and the notification is missing.
# 6  
Old 05-24-2009
Quote:
Originally Posted by TonyFullerMalv
How about:
Code:
errpt |awk '{print $2,$6" "$7}'

?
I could do this but is there another way around.
Your method above will not solve the issue if another new error occurs which is longer. For example "software program abnormally terminated"
It wont make sense to specify $7 $8 $9 and onwards......there must be an alternative to this.....
# 7  
Old 05-24-2009
Code:
errpt | nawk '{printf("%s%c", $2, OFS); for(i=6;i<=NF;i++) printf("%s%c", $i, (i==NF)?ORS:OFS)}'

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

2. AIX

Production Issue in AIX Oracle RAC [errpt output : DUPLICATE IP ADDRESS DETECTED IN THE NET]

1)We have 2 node cluster RAC on AIX: ->test1 ->test3 2) After rebooting server both the node sequentailly, we are getting below error from errpt command : # errpt |more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION FE2DEE00 0901223914 P S SYSXAIXIF DUPLICATE IP ADDRESS... (2 Replies)
Discussion started by: manjusharma128
2 Replies

3. Shell Programming and Scripting

ls format output

Hello, here is what I've got while using ls -l * in a script : LOG: total 35913 -rw-r--r-- 1 so_nic sonic 833419 Feb 16 06:44 PSYVR3_LOG_PALMPROC_FCST_R20110216.TAR.gz -rw-r--r-- 1 so_nic sonic 2796933 Feb 14 05:11 PSYVR3_LOG_PALMPROC_HDCT_BT_R20110216.TAR.gz SATURNES: total... (3 Replies)
Discussion started by: Aswex
3 Replies

4. Shell Programming and Scripting

problem in understanding the output of errpt -d H -T PERM -s `date +"%m%d%H00%y"`

Its very critical and 'm in need to schedule this on my crontab so that the output can be monitored by a tool I have written the command below to redirect the error which has the output redirected to the file gincle_lol.log. echo "---" >>/gingle/gincle_lol.log date... (1 Reply)
Discussion started by: Sounddappan
1 Replies

5. AIX

Problem in understanding the output of errpt -d H -T PERM -s `date +"%m%d%H00%y"`

Its very critical and 'm in need to schedule this on my crontab so that the output can be monitored by a tool I have written the command below to redirect the error which has the output redirected to the file gincle_lol.log. Code: echo "---" >>/gingle/gincle_lol.log date... (0 Replies)
Discussion started by: Sounddappan
0 Replies

6. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

7. UNIX for Advanced & Expert Users

format df -k output

i am running df -k command on aix machine. i got the output like this. i need to store into file and send that file into microsoft excel.i need to allign properly. Filesystem 512 blocks Free % Used Iused %Iused Mounted on /dev/hd4 262144 126488 52% ... (9 Replies)
Discussion started by: wintercoat
9 Replies

8. UNIX for Advanced & Expert Users

Format the Output

Hi- Objective of the task is to print the lines which doesnt have a END statement corresponding to a START statement. Let me know if anyone has a better way of doing is. My Thoughts Have 2 files one having START lines and another having END lines (sorted). And then diff the files to get... (8 Replies)
Discussion started by: lorcan
8 Replies

9. Shell Programming and Scripting

How to format output

Dear all, I have written a program which access database and displays the values returned by the query . There are 10 columns to be displayed in one row. But am ending with 5 lines displayed on 1st line and the next 5 in the 2nd line. Ex : 21608 10-20-2007 148 Al's Appliance... (7 Replies)
Discussion started by: uday542
7 Replies

10. Shell Programming and Scripting

capturing output from top and format output

Hi all, I'd like to capture the output from the 'top' command to monitor my CPU and Mem utilisation.Currently my command isecho date `top -b -n1 | grep -e Cpu -e Mem` I get the output in 3 separate lines.Tue Feb 24 15:00:03 Cpu(s): 3.4% us, 8.5% sy .. .. Mem: 1011480k total, 226928k used, ....... (4 Replies)
Discussion started by: new2ss
4 Replies
Login or Register to Ask a Question