Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Syslog files revisited

by stevbutt (Novice)
on Aug 10, 2012 at 13:51 UTC ( [id://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 ?

Replies are listed 'Best First'.
Re^3: Syslog files revisited
by johngg (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://986751]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-03-19 02:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found