[Logwatch] Sudo formatting scriipt

Erik Ogan erik@slackers.net
Sun, 21 Apr 2002 10:01:26 -0700


This is a multi-part message in MIME format.
--------------050601000601020301060003
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I've been sitting on this for long enough. I got tired of trying to 
decypher sudo entries in my secure-log, so I wrote a formatting script 
to colate & format sudo logs.

I suspect that there are others out there who have been bothered as 
well, I'm just the first to break the pull of inertia and do something 
about it.

Oh, those who edit in vi may want to "expand -8" this file to save your 
sanity (and my intended indentation)

I also believe I've found some fundamental flaws in the design of 
logwatch, but I'll keep them to myself until I have time to upgrade to 
the latest version. ;)

Questions and comments are welcome.

-e

--------------050601000601020301060003
Content-Type: application/x-java-vm;
 name="sudo"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="sudo"

IyEvdXNyL2Jpbi9wZXJsIC1udwojCiMgc3VkbzogQSBsb2d3YXRjaCBzY3JpcHQgdG8gY29s
bGF0ZSBhbmQgZm9ybWF0IHN1ZG8gbG9nIGVudHJpZXMgZnJvbQojCXRoZSBzZWN1cmUgbG9n
LiBFbnRyaWVzIGFyZSBicm9rZW4gZG93biBieSB0aGUgdXNlciB3aG8gaXNzdWVkCiMJdGhl
IGNvbW1hbmQsIGFuZCBmdXJ0aGVyIGJ5IHRoZSBlZmZlY3RpdmUgdXNlciBvZiB0aGUgY29t
bWFuZC4KIwojCURldGFpbCBMZXZlbHM6CiMJIDA6IEp1c3QgcHJpbnQgdGhlIGNvbW1hbmQK
IwkyMDogSW5jbHVkZSB0aGUgY3VycmVudCBkaXJlY3Rvcnkgd2hlbiB0aGUgY29tbWFuZCB3
YXMgZXhlY3V0ZWQKIwkgICAgKG9uIGEgc2VwYXJhdGUgbGluZSkKIwkzMDogSW5jbHVkZSB0
aGUgVFRZIG9uIHRoZSBkaXJlY3RvcnkgbGluZQojCiMgJElkOiBzdWRvLHYgMS43IDIwMDIv
MDQvMjEgMTY6NDU6NTggZXJpayBFeHAgJAoKdXNl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