Splunk Search

How to split events in multiline raw data and extract fields?

vangal_sandeep
New Member

I have some data and  I am trying to  extract fields from multi line raw data.

 

TIMESTAMP=23-12-2021,Eligible_to_be_Purged=0,Total_Records_Inserted=79871,Row_Count=0,NUMORDERSPURGED=14267,INVOCATIONS=781016,AVERAGE=101.76,MAXIMUM=171465,NUMOFGETJOBSPROCESSED=163,GETJOBS_AVERAGE=17114.57 TIMESTAMP=24-12-2021,Eligible_to_be_Purged=0,Total_Records_Inserted=51367,Row_Count=0,NUMORDERSPURGED=206884,INVOCATIONS=471196,AVERAGE=981.21,MAXIMUM=237037,NUMOFGETJOBSPROCESSED=97,GETJOBS_AVERAGE=14298.03 TIMESTAMP=25-12-2021,Eligible_to_be_Purged=0,Total_Records_Inserted=57405,Row_Count=0,NUMORDERSPURGED=51558,INVOCATIONS=205747,AVERAGE=960.54,MAXIMUM=301445,NUMOFGETJOBSPROCESSED=45,GETJOBS_AVERAGE=36616.87

 

I wanted exact all fields from all 3 lines.

 

 

 

 

Labels (1)
Tags (2)
0 Karma

sperkins
Path Finder

You can use the field extractor to extract the fields based on the "," as the delimiter. 
Or | rex in the search bar.  Using the K=V pair extraction. (?<_KEY_1>[^=]+)=(?<_VAL_1>[^,]+),?
https://regex101.com/


Then use |eval <field> = mvindex(<ref_field>, #) To reference each value in a search, or you can use the | eval mvexpand()  function to split them into multiple events based on the field specified. 

https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/mvexpand

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Don't do that. Split the event into separate events and then parse it. If you'll try to parse values from the event as such you're running into possibility of having "squished" multiple values. And the multivalued fields that you'd get as a result of parsing would be in no formal relation to one another.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...