Splunk Search

Values with Pipe as String

andimak
New Member

Hi,

I have events which look like that:
a=test1 b=test2 func=test3|test4|test5
and
a=test1 b=test2 func=test5

if a make a search on func i get results like test3 or test5, but i want "test3|test4|test5" and test5 as result.
I tried to extract a new Field but its not working like i want it. It doesnt work with a delimiter space cause i will get the other key=value pairs too in this extracted field. And I dont really know how to make the regex extracted field to do this.

regards

Tags (1)
0 Karma

DalJeanis
Legend

In a search pipeline, you can do this to turn those three values into single values in a multivalue field...

| makemv delim="|" func

Here's a related answer - https://answers.splunk.com/answers/174880/how-to-extract-pipe-separated-subfields-from-a-fie.html

Hmmm. The pipes should not interfere with a normal extraction or a normal search.

Just be aware that with any command using regular expressions (regex, match, etc) you will need to escape the pipe character, or it will be interpreted as "OR".

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...