Splunk Search

How to concatenate Dynamic multivalue fields to single value fields?

wealot
Engager

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
Engager

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

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...