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!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...