Splunk Search

erex or IFE with comma

tb5821
Communicator

How do I use the IFA or even better erex and specify mutiple values that contain a comma? I've tried putting them in quotes etc but doesn't seem to work.

I really just trying to extract a date from our logs which starts with the year and ends in 00

Tags (2)
0 Karma

lguinn2
Legend

When doing field extraction, Splunk may look at fields containing commas as "multi-valued" fields - or not, depending on your configuration.

erex might not be a good choice for dealing with this, because it uses commas to separate the sample values. For the example that @garywiner provided, this will work

yoursearchhere
| rex field=_raw "Name=(?<lastname>.+?)\,(?<firstname>.+?)\;"

This creates two fields, lastname and firstname... You could use a similar regular expression in a props.conf EXTRACT to make these fields permanent.

0 Karma

lguinn2
Legend

Can you post an example of the data that you are working with - and how the field should be extracted? I think this would be easier with a concrete example.

BTW, I think you mean the IFX (Interactive Field Extractor).

0 Karma

garywiner
New Member

Same question, but something even simpler. The field contains "lastname,firstname".
Name=IDAHO,DUNCAN;
Name=JONES,JOHN;

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...