All Apps and Add-ons

Extract fields from comma seperated list

jbesant
Explorer

Hello, I've just started using Splunk and have managed to extract a few fields from my source to create graphs and a dashboard but I am struggling with the Regx for the following:

04/06/2014 10:30:34,OEL_REPLEN_EVENT,sys_proc op_replen_sequencer,"Product code 71104449, Master TM 81117517, Insert TM 41030090, Quantity 4, Reason OTHER STOCK IN TRAY "

I am trying to extract the information in the message that is between the quotes,i.e. Product Code, Master TM, Reason

There are several different Reason which could be made up of anything between 2 and 4 words. In some cases there will be blank entries after Insert TM.

Hope someone can help! Thanks.

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

If that's the first occurrence of double quotes you can use this regex:

,"(?<quoted_field_name>[^"]+)"

View solution in original post

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

If that's the first occurrence of double quotes you can use this regex:

,"(?<quoted_field_name>[^"]+)"
0 Karma

jbesant
Explorer

Many thanks that was what I needed. I entered:

(?i) Reason (?P[^"]+)

this and it pulled out all the Reason phrases

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

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

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...