Splunk Search

How do I delimit multivalue fields?

anil_ec21
Explorer

Dear All,

We have a scenario, where For each Application_ID, Application_Name is having multi-value and delimited.

we would like the data loaded into individual rows, in the following manner -

Example: Application_Name is multi-value and delimited (A:B:C)

Application_ID Application_Name
1 A:B:C
2 D:E:F

Desired Output:

Row 1: 1 A
Row 2: 1 B
Row 3: 1 C
Row 4: 2 D
Row 5: 2 E
Row 6: 2 F

How do I accomplish this?

Thanks in Advance
Anil

1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi

Can you please try this search?/

YOUR SEARCH | makemv delim=: Application_Name | mvexpand Application_Name

Thanks

View solution in original post

sbbadri
Motivator

@anil_ec21

try this

| makeresults
| eval Application_ID="1;2"
| eval Application_Name="A:B:C;D:E:F"
| eval Application_ID=split(Application_ID,";")
| eval Application_Name = split(Application_Name,";")
| eval test=mvzip(Application_ID,Application_Name)
| mvexpand test
| fields test
| rex field=test max_match=0 "(?P<v2>\d+),(?P<v2>\S+)"
| eval v2=split(v2,":")
| mvexpand v2
| rename v1 as Application_ID, v2 as Application_Name
| table Application_ID Application_Name

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi

Can you please try this search?/

YOUR SEARCH | makemv delim=: Application_Name | mvexpand Application_Name

Thanks

anil_ec21
Explorer

Thanks for the quick reply Kamlesh. Your query worked. 🙂

0 Karma

niketn
Legend

@anil_ec21, please accept kamlesh_vaghela's answer if this helped.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
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 ...