<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Query for Users, Roles, AD Groups and Indexes. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/483826#M193377</link>
    <description>&lt;P&gt;HI @harsmarvania57. Thanks for the query. I had to make a small change to get it working by adding the following in the 3rd line&lt;/P&gt;

&lt;P&gt;| rename title as userid&lt;/P&gt;

&lt;P&gt;and including it in the stats&lt;/P&gt;</description>
    <pubDate>Fri, 20 Sep 2019 05:53:51 GMT</pubDate>
    <dc:creator>aknsun</dc:creator>
    <dc:date>2019-09-20T05:53:51Z</dc:date>
    <item>
      <title>Query for Users, Roles, AD Groups and Indexes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/483824#M193375</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to get the query to pull out the following, but struggling a bit with all the joins. I need to get a list of the following in a report.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;List of users&lt;/LI&gt;
&lt;LI&gt;The Roles each user is part of.&lt;/LI&gt;
&lt;LI&gt;The AD Group that each user is part of.&lt;/LI&gt;
&lt;LI&gt;The Indexes that each user has access to.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Looks like I will need to be using the below 4 endpoints.&lt;/P&gt;

&lt;P&gt;/services/authentication/users&lt;BR /&gt;
/services/authorization/roles&lt;BR /&gt;
/services/admin/LDAP-groups&lt;BR /&gt;
/services/data/indexes&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 05:24:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/483824#M193375</guid>
      <dc:creator>aknsun</dc:creator>
      <dc:date>2019-09-19T05:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Query for Users, Roles, AD Groups and Indexes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/483825#M193376</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try below query on Search Head, not sure whether it will give you all information which you require. It is working fine in my lab environment (Which has very few users)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest splunk_server=local /services/authentication/users
| fields title, roles
| mvexpand roles
| append [ | rest splunk_server=local /services/authorization/roles
           | fields imported_roles,imported_srchIndexesAllowed,imported_srchIndexesDefault,srchIndexesAllowed,srchIndexesDefault,title
           | rename title as roles]
| append [ | rest splunk_server=local /services/admin/LDAP-groups
           | fields roles,title
           | rename title as ADGroup]
| stats values(imported_roles) as imported_roles, values(imported_srchIndexesAllowed) as imported_srchIndexesAllowed, values(imported_srchIndexesDefault) as imported_srchIndexesDefault, values(srchIndexesAllowed) as srchIndexesAllowed, values(srchIndexesDefault) as srchIndexesDefault, values(title) as userid, values(ADGroup) as ADGroup by roles
| mvexpand userid
| stats values(imported_roles) as imported_roles, values(imported_srchIndexesAllowed) as imported_srchIndexesAllowed, values(imported_srchIndexesDefault) as imported_srchIndexesDefault, values(srchIndexesAllowed) as srchIndexesAllowed, values(srchIndexesDefault) as srchIndexesDefault, values(roles) as roles, values(ADGroup) as ADGroup by userid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Sep 2019 08:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/483825#M193376</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-09-19T08:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Query for Users, Roles, AD Groups and Indexes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/483826#M193377</link>
      <description>&lt;P&gt;HI @harsmarvania57. Thanks for the query. I had to make a small change to get it working by adding the following in the 3rd line&lt;/P&gt;

&lt;P&gt;| rename title as userid&lt;/P&gt;

&lt;P&gt;and including it in the stats&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 05:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/483826#M193377</guid>
      <dc:creator>aknsun</dc:creator>
      <dc:date>2019-09-20T05:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Query for Users, Roles, AD Groups and Indexes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/544321#M193378</link>
      <description>&lt;P&gt;It's not working for our environment. Do we have any alternative query for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually in LDAP rest api query , we are only getting admin, user,power , splunk-system-user roles i'm getting.. Due to that, i'm not getting proper results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please help me.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 11:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-Users-Roles-AD-Groups-and-Indexes/m-p/544321#M193378</guid>
      <dc:creator>sriniwf</dc:creator>
      <dc:date>2021-03-18T11:50:43Z</dc:date>
    </item>
  </channel>
</rss>

