Splunk Search

Need Regex to pull all the pid,PPID and MD5 values

SabariRajanT
Path Finder
 
Labels (2)
0 Karma

venkatasri
SplunkTrust
SplunkTrust

@SabariRajanT  you can try this however they should have been auto extracted for you. Did you try to run in Verbose mode?

| rex field=_raw "\\\"pid\\\"\:(?<pid>\d+)" 
| rex field=_raw "\\\"ppid\\\"\:(?<ppid>\d+)" 
| rex field=_raw "\\\"md5\\\"\:\\\"(?<md5>\S+)\\\""

Alternatively you can use the | spath command as well.

---

An upvote would be appreciated if this reply helps! 

PickleRick
SplunkTrust
SplunkTrust

At first glance it looks that they should be auto-extracted but notice that most of the data in the example is not a json section but a string. So you'd need to separately parse it as json (or extract with a regex, as you showed. Also, it's worth noticing that the value you'll get from your regexes will need to be unescaped.

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...