Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: Syslog files revisited

by stevbutt (Novice)
on Aug 10, 2012 at 13:51 UTC ( #986751=note: print w/ replies, xml ) Need Help??

in reply to Re: Syslog files revisited
in thread Syslog files revisited

Thanks John, Almost all lines are now being loaded correctly but I have one further problem with occasional lines and specifically just on the user= part.

Sometimes it says this

user=gonenow sent=34 recv=34


user=<gonenow>, etc etc

Instead of the comma separated list I expected

Is there a way to just extract my user value up until either a comma or space and to strip < > if they occur ?

Comment on Re^2: Syslog files revisited
Select or Download Code
Replies are listed 'Best First'.
Re^3: Syslog files revisited
by johngg (Abbot) on Aug 10, 2012 at 19:06 UTC

    The user=<gonenow>, etc etc case can probably be got around with a couple of minor changes to the code. The user=gonenow sent=34 recv=34 is more of a problem as it fails the premise on which the split approach was based. I'd probably wrap the original code in an if condition and deal with the non-comma-separated lines in an else clause.

    It just so happens that I am about to go on holiday so I will not be able to provide further help for a week or so. I suggest you create another question in SoPW, linking to this thread, and post some example data lines illustrating your problem so that others can perhaps help you build on the solution you have so far.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986751]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2015-11-26 16:23 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (701 votes), past polls