Refine your search:

I have an event with a field like this: ids="ID-120-1, ID-141-5, ID-92-5, N/A"

I'd like to extract the field and only keep IDs (i.e. I don't want the "N/A" value).

I have a transforms entry like this:

[mv-ids]
REGEX = \bid=\"(?<id>(ID-\d+-\d+)+)
MV_ADD = true

and my props.conf

[mysourcetype]
REPORT-ids = mv-ids

This isn't working as I would hope though. I'm only getting the first ID. What do I need to do to get all of the IDs added to the id field?

asked 12 Dec '10, 21:35

mw's gravatar image

mw
1.7k215
accept rate: 29%

edited 12 Dec '10, 21:47


2 Answers:
link

answered 13 Dec '10, 00:41

mw's gravatar image

mw
1.7k215
accept rate: 29%

edited 14 Dec '10, 23:41

I don't think you need the last plus sign.

Try:

REGEX = \bid=\"(?<id>(ID-\d+-\d+))
FORMAT = mv-id::$1

Jim

link

answered 12 Dec '10, 22:19

jamesdon's gravatar image

jamesdon
518
accept rate: 0%

That doesn't seem to work. I end up with 1 entry in the field and it's the entire string. Oh, I was so hopeful. I'm about to put my head through a wall. :)

(12 Dec '10, 22:46) mw
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:

×462
×89

Asked: 12 Dec '10, 21:35

Seen: 881 times

Last updated: 14 Dec '10, 23:41

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