how to remove certain entries within a file in AIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to remove certain entries within a file in AIX
# 1  
Old 02-05-2010
how to remove certain entries within a file in AIX

I have a rather large log file on our AIX server that contains syslog entries, with each line beginning with the date/time the message was received. The date goes back to Aug 17th of last year. I need to remove all lines within this log file that have its messages earlier than Nov 5th, and keep anything after that. These are the first 3 lines of the file, just to show you what I am talking about.

Aug 17 00:10:54 10..x.x.x local7:info %PIX-6-305012: Teardown dynamic UDP translation from dmz:200.x.x.x/57949 to internet:129.33.35.22/46963 duration 0:02:30
Aug 17 00:10:54 10..x.x.x local7:info %PIX-6-305012: Teardown dynamic UDP translation from dmz:10.x.x.x/123 to internet:170.224.52.43/215 duration 0:02:30
Aug 17 00:10:54 32.243.9.45 local7:info %PIX-6-302020: Built outbound ICMP connection for faddr 10.x.x.x/0 gaddr 32.x.x.x/56697 laddr 32.243.6.139/56697

Assuming the log file is called "syslog.log", how do I strip out all entries prior to Nov 5th?
# 2  
Old 02-05-2010
How about:
Code:
sed '/^Nov  5/,$!d' syslog.log > syslog.stripped

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Remove SSH at AIX

hi guys, I have a problem at my ssh, I dont have remove ssh from the my aix system. Command not work. smit remove Give me solutions guys.. thank you.. :D:D (3 Replies)
Discussion started by: williamen
3 Replies

2. AIX

How to Remove the entire AIX?

Hello, Kindly guide me how to erase all the AIX 6.1 OS ASAP! (1 Reply)
Discussion started by: ahmedamer12
1 Replies

3. Shell Programming and Scripting

Filter a .kml file (xml) to remove unwanted entries

Ok, i have a .kml file that that i want to trim down and get rid of the rubbish from. its formatted like so: <Placemark> <name><!]></name> <description><!</b><br/>Frequency: <b>2437</b><br/>Timestamp: <b>1304892397000</b><br/>Date: <b>2011-05-08... (11 Replies)
Discussion started by: Phear46
11 Replies

4. AIX

How to remove the entry for the path in aix

Hi The below command shows as root@cbspsdb02 #export MQSI_USER_EXIT_PATH64=/opt/IBM/ITM/aix513/d4/KD4/config/wmb61/lib root@cbspsdb02 #print $MQSI_USER_EXIT_PATH64 /opt/IBM/ITM/aix513/d4/KD4/config/wmb61/lib I need to remove the entry for the path "$MQSI_USER_EXIT_PATH64". That is... (3 Replies)
Discussion started by: samsungsamsung
3 Replies

5. AIX

How to add/remove additional DNS and IP to AIX

Hello, How to add/remove additional DNS and IP to AIX ? I wanted to add 3 more new DNS and IP addresses to existing AIX 5.2. (1 Reply)
Discussion started by: balareddy
1 Replies

6. AIX

How to disable/remove c-shell in aix?

Hi Team, I want to either disable C-shell permanently from my system. since the package bos.rte.shell 5.3.9.2 APPLIED Shells (bsh, ksh, csh) contains all 3 shells, please guide me how I can remove or permanently disable cshell from my box. I know I can rename /usr/bin/csh and disable but... (2 Replies)
Discussion started by: falgun6666
2 Replies

7. AIX

Remove APAR number from aix 5.3

Hi... Can i remove one APAR number from aix5.3.. If it is possible how to do.. Thanks.. (3 Replies)
Discussion started by: sumathi.k
3 Replies

8. AIX

Can not remove static route from AIX 5.3

Dear all, I Try to remove a static route with smitty, but recieve this error: Method error (/usr/lib/methods/chginet): 0514-009 Cannot delete an object from the device configuration database. 0821-216 chginet: Cannot delete route (net,192.168.30.101,192.168.30.1)... (2 Replies)
Discussion started by: hrkama
2 Replies

9. Infrastructure Monitoring

Remove Similar entries in a File

-------------------------------------------------------------------------------- I have a log file "logreport" that contains several lines as seen below: 04:20:00 /usr/lib/snmp/snmpdx: Agent snmpd appeared dead but responded to ping 06:38:08 /usr/lib/snmp/snmpdx: Agent snmpd appeared... (2 Replies)
Discussion started by: Nysif Steve
2 Replies

10. Shell Programming and Scripting

Remove first N bytes and last N bytes from a binary file on AIX.

Hi all, Does anybody know or guide me on how to remove the first N bytes and the last N bytes from a binary file? Is there any AWK or SED or any command that I can use to achieve this? Your help is greatly appreciated!! Best Regards, Naveen. (1 Reply)
Discussion started by: naveendronavall
1 Replies
Login or Register to Ask a Question