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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...