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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...