Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

Or

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
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.

    Cheers,

    JohnGG

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-08-01 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (50 votes), past polls