Splunk Search

How to extract multiple values from a multi-value field and use these in a table?

mal81394
New Member

I have a multivalue field (custom_4) separated by dollar signs that I have separated in to separate values with the below search. However, that only separate each value to a different line on the same row. I would like to create column headers for each new value and put each new value under a column header. Basically, when I split the multi value field using makemv I want the new single values to appear across the row for the same record with separate column names instead of just multiple rows as it is now. The new column headers (fields) would be: Tool, ID, Severity,Incident Id, Progress. Thanks!

index=UIM sourcetype=nas_transaction_log 
| makemv delim="$" custom_4
| top limit=20 custom_4

Before:

"Tool name"
"ID#"
"Severity"
"incident id#"
"status"

What I want:

Tool                            ID                  Severity                 Incident ID             Progress
"Tool name"           "ID#"               "severity"              "incident#"             "status"
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Here's one (untested) way. There may be others.

index=UIM sourcetype=nas_transaction_log 
| makemv delim="$" custom_4
| eval Tool=mvindex(custom_4,0), ID=mvindex(custom_4, 1), Severity=mvindex(custom_4, 2), 'Incident ID'=mvindex(custom_4, 3), Progress=mvindex(custom_4, 4)
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Here's one (untested) way. There may be others.

index=UIM sourcetype=nas_transaction_log 
| makemv delim="$" custom_4
| eval Tool=mvindex(custom_4,0), ID=mvindex(custom_4, 1), Severity=mvindex(custom_4, 2), 'Incident ID'=mvindex(custom_4, 3), Progress=mvindex(custom_4, 4)
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...