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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...