Refine your search:

Hi,

iam trying to extract certain values from my log files which i have given below 1st event at x.x.x.x.x.x(1) at x.x.x.x.x.x.x.x(2) at X.x.x.x.x.x.x.x.xx(3) ........... 2nd event at x.x.x.x.x.x(4) at x.x.x.x.x.x.x.x(5) at X.x.x.x.x.x.x.x.xx(6) ............... ......... The issue iam facing is iam getting only first line of every event starting with "at", not the all lines in one event itself.I want all the values after "at" in each events" the output iam getting is like this

x.x.x.x.x.x(1) x.x.x.x.x.x.x.x(5)

This is the regex iam using

rex field=_raw "ats(?<value>.*)s"

asked 05 May '12, 03:39

john's gravatar image

john
6119
accept rate: 0%

edited 07 May '12, 03:15


One Answer:

rex only matches one time by default. This behaviour is controlled by the max_match parameter, so if you want more matches just set it to something higher:

... | rex max_match=10 field=_raw "at\s(?<value>.*?)\s"
link

answered 05 May '12, 03:51

Ayn's gravatar image

Ayn
25.2k3717
accept rate: 41%

Thanks Ayn,Its working fine..........

(06 May '12, 21:37) john
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:

×137

Asked: 05 May '12, 03:39

Seen: 1,138 times

Last updated: 07 May '12, 03:15

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