Splunk Search

Compare values in two different json objects

barosan007
Explorer

Hello, 

This question has probably been asked and answered, but I just can't seem to find a best solution. 

So, in the results I want to table the Allow and Deny values. And the second result would be the | search Action=eks* only where the Effect is Allow. I have tried till now, but I cannot relate the Allow action, it lists all values. Thanks in Advance. 



{ "Action": [
"eks:*",
"ecs:*"
],
"Effect": "Allow"
 
},
{
"Action": [
"config:*",
"budgets:*"
],
"Effect": "Deny",
}
Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| spath "Action{}" output="Action"
| spath "Effect"
| mvexpand Action

View solution in original post

barosan007
Explorer

Finally, this worked for me.  Thanks for advice. 

| mvexpand Json
| spath "Action{}" input=Json output="Action"
| spath "Effect" input=Json output="Effect"
| mvexpand Action
| table Action Effect
0 Karma

barosan007
Explorer
Action NameEffect
eksallow
ecsallow
configdeny
budgetsdeny
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| spath "Action{}" output="Action"
| spath "Effect"
| mvexpand Action

ITWhisperer
SplunkTrust
SplunkTrust

Please can you give an example of your expected results?

Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...