stevbutt has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for the suggestions, looks to me like Syslog is just too variable however I have another idea
My lines look like the following
May 2 04:06:15 lon-pop.mail.mydom.com pop3login: LOGOUT, user=gonenow, ip=[::ffff:127.0.0.1], top=0, retr=0, rcvd=24, sent=5560, time=1The first three parts are pretty standard i.e. datetime( though with no year ) sysloghost, operation then the variable message.
What I would like to do is convert this to a csv line as follows where its broken into at least four parts but if the string user=gonenow appears then add gonenow ( or whatever the users name was ) as an extra field, same for ip=
02/05/2012 04:06:15,lon-pop.mail.mydom.com,pop3login,"LOGOUT, user=gonenow, ip=[::ffff:127.0.0.1], top=0, retr=0, rcvd=24, sent=5560, time=1</c>",gonenow,::ffff:127.0.0.1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dealing with Syslog files
by zentara (Cardinal) on Jul 31, 2012 at 16:19 UTC | |
|
Re: Dealing with Syslog files
by grumbert (Scribe) on Jul 31, 2012 at 16:22 UTC | |
|
Re: Dealing with Syslog files
by cdukes (Initiate) on Aug 02, 2012 at 13:53 UTC |