Refine your search:

Hello All,

What is the best way to extract into a single field mutiple values from a comma-seperated list:

Example: xxxx Books:1,2,3,65,2,5 xxxxxx

From this I have created a field called Books which contains the string 1,2,3,65,2,5 however what I would like to do is create a field called Books which takes each value as a single entry.

So from the above example I would have 6 entries in the field Book for this particular log entry.

asked 15 Apr '10, 11:30

Josh's gravatar image

Josh
166116
accept rate: 0%


2 Answers:

If you have extracted the field Books with a single value of 1,2,3,65,2,5 and want it to report as a multi-valued attribute, try this at search time:

Books = * | makemv delim="," Books

link

answered 15 Apr '10, 12:43

bwooden's gravatar image

bwooden ♦
2.9k1310
accept rate: 37%

Just in case, the other option is to use transforms.conf and fields.conf

http://wiki.splunk.com/Community:Comma-Separated_Multi-Value_Field_Extraction_In_Single-line_Event

(06 Nov '11, 10:50) Masa ♦

This can be easily done through regex on your props.conf & transforms.conf:

  • props.conf
[sourcetype_for_the_csv]
REPORT-multifield = multifield
  • transforms.conf
[multifield]
REGEX = Books:(\d+,\d+,\d+,\d+,\d+,\d+)
FORMAT = book::$1
link

answered 15 Apr '10, 12:21

BunnyHop's gravatar image

BunnyHop
8369828
accept rate: 25%

edited 15 Apr '10, 17:07

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:

×540

Asked: 15 Apr '10, 11:30

Seen: 1,644 times

Last updated: 06 Nov '11, 10:50

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