Splunk Search

Search using results of a search

LynneEss
Engager

I have a working search that we use to give a list of the members of admin groups in Active Directory:

| inputlookup AD_Groups_LDAP_list
| where group_name="Domain Admin"  OR group_name="Local Admin"
| mvexpand group_members
| table cn, group_members

 

Some of the group_members are groups themselves so I would like to do a further search to find the members of the groups that are members of the admin groups (hope this makes sense)

I can identify which group_members are another group by the naming conventions we use (the groups will always begin with "Role_") but I'm not sure how I can do the next query to return the members of the "Role_" groups within the same search.

 

1 Solution

rupkumar4sec
Path Finder

Not a best one but I guess it will do the job

| inputlookup AD_Groups_LDAP_list
| where group_name="Domain Admin"  OR group_name="Local Admin"
| mvexpand group_members
| table cn, group_members
| lookup AD_Groups_LDAP_list group_name as group_members OUTPUT group_members as group_members1
|  mvexpand group_members1
| eval group_members = coalesce(group_members1, group_members)

 

View solution in original post

rupkumar4sec
Path Finder

Not a best one but I guess it will do the job

| inputlookup AD_Groups_LDAP_list
| where group_name="Domain Admin"  OR group_name="Local Admin"
| mvexpand group_members
| table cn, group_members
| lookup AD_Groups_LDAP_list group_name as group_members OUTPUT group_members as group_members1
|  mvexpand group_members1
| eval group_members = coalesce(group_members1, group_members)

 

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

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...