D
Daniel Völkerts
I started written a little script to analyse my syslogs. The development
went on very fast, but today I'm searching the rubish way to dissect a
string into some parts. For example in my syslog there is a line (valid
as described in rfc3146)
<165> Aug 16 17:01:35 localhost Just a test
I was trying to reach this form
var = content
pri = 165
timestamp = Aug 16 17:01:35
device = localhost
msg = Just a test
But how do I accomplish this? I read the pickaxe book, but the example I
found was about repeating values e.g. | as seperator. Is a suitable
regexp the way or should use another technique e.g. String#index etc.?
Thanks for your time helping me, I'll pay it back if I become a little
more rubisher
went on very fast, but today I'm searching the rubish way to dissect a
string into some parts. For example in my syslog there is a line (valid
as described in rfc3146)
<165> Aug 16 17:01:35 localhost Just a test
I was trying to reach this form
var = content
pri = 165
timestamp = Aug 16 17:01:35
device = localhost
msg = Just a test
But how do I accomplish this? I read the pickaxe book, but the example I
found was about repeating values e.g. | as seperator. Is a suitable
regexp the way or should use another technique e.g. String#index etc.?
Thanks for your time helping me, I'll pay it back if I become a little
more rubisher