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!

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 ...