Splunk Search

Parsing fields inside quoted fields

tfechner
Path Finder

Hi,
at search time I like to pase the key-value pairs inside the message and would like to have the whole message in a field:

log-line:
message="serial="57896" name="test" loc="there""

Per default splunk parses like:
message=serial=
name=test
loc=there

How to get this?
message= serial="57896" name="test" loc="there"
serial=57896
name=test
loc=there

kamlesh_vaghela
SplunkTrust
SplunkTrust

@tfechner

Can you please try this?

Your_search | rex field=_raw "message=\"(?<message>.*)\"$" | eval _raw=message | kv | table message serial name loc

Sample search:

|makeresults | eval _raw="message=\"serial=\"57896\" name=\"test\" loc=\"there\"\"" | rex field=_raw "message=\"(?<message>.*)\"$" | eval _raw=message | kv | table message serial name loc

Thanks

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...