Ok,

For some reason sort -r will not work with sort -t. --key=3,2n options

I tried:

sort -r -t. --key=3,2n
sort -t. -r --key=3,2n
sort -t. --key=3,2n -r

But....

zcat `ls /var/log/audit/*.gz | sort -t. --key=3,2n` | tac | ausearch -i

works like a champ.  Gotta luv linux..

Thnks..


Norman Mark St. Laurent
Conceras | Chief Technology Officer and ISSE
Phone:  703-965-4892
Email:  [email protected]
Web:  http://www.conceras.com

Connect. Collaborate. Conceras.



Steve Grubb wrote:
On Monday 17 August 2009 02:46:30 pm Norman Mark St. Laurent wrote:
Depending if you are using logrotate.d/audit  and how it numbers the
files as it rotates...

audit.log.1.gz
audit.log.2.gz
...
audit.log.89.gz
audit.log.90.gz

The sort below will but the list in exact order....

zcat `ls /var/log/audit/*.gz | sort -t. --key=3,2n` | ausearch -i

For this to work right, it has to be in descending order. So, add a -r to the sort command.

-Steve



--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

Reply via email to