All Apps and Add-ons

Transform Comma Delimited Field (Extraction) Into Row

andrewkenth
Communicator

Is there a way to break a field extraction that is delimited into a new row in a table?

Example Data:

2014-01-21 16:32:48,702 [MainThread] INFO  tData.Data.Refresh.BlotterRefreshHandler -     Blotter Refresh completed for MsgNum = 104, Order table, IDs: 238771427,228715752,238237071,236915854

I'd like to have a table that read something similar to below. What is a good clean way to approach this (or dirty!)?

_time source OrderID
2014-01-21 16:32:48 foo.csv 238771427
2014-01-21 16:32:48 foo.csv 228715752
2014-01-21 16:32:48 foo.csv 238237071
2014-01-21 16:32:48 foo.csv 236915854

0 Karma
1 Solution

linu1988
Champion

Hello,
You can extract the IDs from the event,assuming you are not breaking them into rows before indexing. After you do get the ids on a single field, you just need to split it by ","

...|eval OrderIDs=split(ID,",")|table _time,source,OrderIDs|mvexpand OrderID

Thanks

View solution in original post

linu1988
Champion

Hello,
You can extract the IDs from the event,assuming you are not breaking them into rows before indexing. After you do get the ids on a single field, you just need to split it by ","

...|eval OrderIDs=split(ID,",")|table _time,source,OrderIDs|mvexpand OrderID

Thanks

andrewkenth
Communicator

Perfect! thanks. mvexpand is exactly what I was looking for 🙂

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

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...