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
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...