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.
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
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.