Splunk Search

Splunk query- How to use spath command for the below logs?

uagraw01
Builder

How to use spath command for the below logs i have attached in the screenshot.

IMG_20220512_184747__01__01.jpg

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Sorry, I forgot you need to deal with multiline values

| rex "(?ms)Error log: (?<json>\{.*\})"
| spath input=json

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| rex "Error log: (?<json>\{.*\})"
| spath input=json
0 Karma

uagraw01
Builder

@ITWhisperer Thanks for your reply but it is Not working for me.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What are you getting in the json field?

0 Karma

uagraw01
Builder

@ITWhisperer I have tried this and now it is working fine.

IMG_20220512_195036__01.jpg

0 Karma

uagraw01
Builder

@ITWhisperer  I think rex is not properly working.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Sorry, I forgot you need to deal with multiline values

| rex "(?ms)Error log: (?<json>\{.*\})"
| spath input=json
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

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

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...