Splunk Search

Multivalue field extraction from nested field

b17gunnr
Explorer

 

Hello folks,

I have a series of event results which take the format as shown below:

   appDisplayName: foo
   appId: foo0
   appliedConditionalAccessPolicies: [ [-]
     { [-]
       displayName: All Users Require MFA All Apps
       enforcedGrantControls: [ [+]
       ]
       enforcedSessionControls: [ [+]
       ]
       id: foo1
       result: success
     }
     { [-]
       displayName: macOS Conditional Access Policy
       enforcedGrantControls: [ [+]
       ]
       enforcedSessionControls: [ [+]
       ]
       id: foo2
       result: success
     }
     { [-]
       displayName: Global-Restrict
       enforcedGrantControls: [ [+]
       ]
       enforcedSessionControls: [ [+]
       ]
       id: foo3
       result: notApplied
     }
     { [-]
       displayName: All_user_risk_policy
       enforcedGrantControls: [ [+]
       ]
       enforcedSessionControls: [ [+]
       ]
       id: foo4
       result: notApplied

Is there a way to cycle through the specific event to extract and maintain the correlation of field:value and then repeat for one or more event blocks? Effectively it would look like this:

displayName: All Users Require MFA All Apps - id: foo1 - result: success

displayName: macOS Conditional Access Policy - id: foo2 - result: success

displayName: Global-Restrict - id: foo3 - result: notApplied

displayName: All_user_risk_policy - id: foo4 - result: notApplied

Thank you to all.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| spath appliedConditionalAccessPolicies{} output=appliedConditionalAccessPolicies
| mvexpand appliedConditionalAccessPolicies
| spath input=appliedConditionalAccessPolicies

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| spath appliedConditionalAccessPolicies{} output=appliedConditionalAccessPolicies
| mvexpand appliedConditionalAccessPolicies
| spath input=appliedConditionalAccessPolicies

b17gunnr
Explorer

This was it. Thank you for the assist.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Extract appliedConditionalAccessPolicies as a whole, expand the multivalued field, then extract each row separately.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...