Refine your search:

I am trying to pick out all the Email addresses from the sample data below:

USER:Peter Pan EMAIL:email@email.com EMAIL:email1@email.com EMAIL:email2@email.com EMAIL:email3@email.com EMAIL:email4@email.com EMAIL:email5@email.com USER:Bob Scott EMAIL:email@email.com EMAIL:email1@email.com EMAIL:email2@email.com EMAIL:email3@email.com EMAIL:email4@email.com EMAIL:email5@email.com USER:Tomas Uncle EMAIL:email@email.com EMAIL:email1@email.com EMAIL:email2@email.com EMAIL:email3@email.com EMAIL:email4@email.com EMAIL:email5@email.com

Now this regex with rex works fine and picks up all the email addresses

rex field=_raw max_match=15 "EMAIL:(?<test>.*?)\n"

But how do i specify in transforms.conf to match multiple times??

There is no max_match option for transforms.conf Here is my transforms.conf

[get-emails] REGEX = ^EMAIL:(.*?)\n FORMAT = Emails::$1

As you can see i tried both types of supported regex's in the transforms.conf file.

Any ideas?

asked 13 May '11, 04:12

lohans's gravatar image

lohans
133
accept rate: 0%

edited 13 May '11, 04:56


One Answer:

You can use the MV_ADD option in your transforms stanza:

[get-emails]
REGEX = EMAIL:(\S+)
FORMAT = Emails::$1
MV_ADD = true
link

answered 13 May '11, 05:25

ziegfried's gravatar image

ziegfried ♦
10.1k1618
accept rate: 52%

edited 13 May '11, 05:34

Now that was easy! Thanks a million! ;-)

(13 May '11, 06:16) lohans
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:

×461
×141
×136

Asked: 13 May '11, 04:12

Seen: 979 times

Last updated: 13 May '11, 06:16

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