Refine your search:

Hello,

I am trying to extract fields from an event which looks like this (I have multiple events)

total time (ms): 5 
web server processing time (ms/%): 2 40 
transmission time (ms/%): 3 60 
bytes sent/received: 100 200 
start time (ms): 1234 
end time(ms): 2345

some lines have one field, and other have two fields making it impossible for me to extract these numbers. I would like splunk to create two separate fields for the lines which have two parameters but I have not been successful in doing so. Anyone have any idea(s) to get this to work? Or is this not possible. Thanks!

asked 22 Jun '10, 23:06

hiwell's gravatar image

hiwell
23117
accept rate: 0%

I ended up writing a script to pre-process the file to make the data Splunk-friendly.

(25 Jun '10, 18:57) hiwell

One Answer:

You may need to break every line as an event and define two regex like:

REGEX...:(\d+)\s+(\d+) FORMAT=field1::$1 field2::$2

REGEX=...:(\d+) FORMAT=field3::$1

link

answered 23 Jun '10, 02:45

katalinali's gravatar image

katalinali
802211
accept rate: 0%

:( it definitely pulls out a few of the fields but its very redundant and the regexes triggers for all the events giving a lot of garbage fields. Thanks though! This could be useful for other cases

(29 Jun '10, 18:23) hiwell
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×536
×92

Asked: 22 Jun '10, 23:06

Seen: 1,257 times

Last updated: 23 Jun '10, 02:45

Copyright © 2005-2012 Splunk Inc. All rights reserved.