Splunk Search

How to concatenate Dynamic multivalue fields to single value fields?

wealot
Explorer

Hi all,

I have events coming in that have multivalue fields, but not always the same fields are multivalue. I want all the fields in the events resulting from a search to be concatenated to single value field.

Example:

Result now shows:

dest       xyz

                fff

Result should show:

dest   xyz [delimiter] fff

Just to be sure that everyone understand using dest here is an example it should be a query that I can run that would actually change every multivalue field regardless of field name.

Cheers,

Labels (1)
Tags (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| foreach *
    [| eval <<FIELD>>=mvjoin(<<FIELD>>,",")]

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| foreach *
    [| eval <<FIELD>>=mvjoin(<<FIELD>>,",")]
0 Karma

wealot
Explorer

Mind blown! I did not know that foreach existed in Splunk, thanks!

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Brett Adams

In our third Spotlight feature, we're excited to shine a light on Brett—a Splunk consultant, innovative ...

Index This | What can you do to make 55,555 equal 500?

April 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...