<?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: How can I search a list of users with all the roles and indexes assigned? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184705#M53204</link>
    <description>&lt;P&gt;But your search only showed the admin role and indexes only show (_*) and not all the indexes&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2015 19:04:24 GMT</pubDate>
    <dc:creator>cdo_splunk</dc:creator>
    <dc:date>2015-06-30T19:04:24Z</dc:date>
    <item>
      <title>How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184703#M53202</link>
      <description>&lt;P&gt;I found this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/data/indexes | table title | rename title as index_name | eval joinfield=if(substr(index_name,1,1)="_","I","NI")
| join type=left max=0 joinfield [| rest /services/authorization/roles | table title srchIndexesAllowed | rename title as Role
| mvexpand srchIndexesAllowed | dedup Role, srchIndexesAllowed| eval joinfield=if(substr(srchIndexesAllowed,1,1)="_","I","NI")
| rex field=srchIndexesAllowed mode=sed "s/[*]/%/g"] | where like(index_name,srchIndexesAllowed) | table index_name, Role
| join type=left max=0 Role [| rest /services/authentication/users | table title , roles | mvexpand roles | rename title as User, roles as Role]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I have a can_delete role, but it is not listed&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 18:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184703#M53202</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2015-06-30T18:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184704#M53203</link>
      <description>&lt;P&gt;You can try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/authentication/users |rename title as User, roles as Role |stats count by  User Role |fields - count| appendcols [ |rest /services/authorization/roles |table title srchIndexesAllowed|rename title as Role]|stats values(Role) as Role values(srchIndexesAllowed) as Indexes by User
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2015 18:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184704#M53203</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-06-30T18:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184705#M53204</link>
      <description>&lt;P&gt;But your search only showed the admin role and indexes only show (_*) and not all the indexes&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 19:04:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184705#M53204</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2015-06-30T19:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184706#M53205</link>
      <description>&lt;P&gt;Try it again. If you see *, that means All Indexes.  &lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 19:24:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184706#M53205</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-06-30T19:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184707#M53206</link>
      <description>&lt;H1&gt;your search showed like this&lt;/H1&gt;

&lt;P&gt;&lt;CODE&gt;User   Role    Indexes&lt;BR /&gt;
admin   admin   * _*&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;does not showed all indexes name&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 19:29:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184707#M53206</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2015-06-30T19:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184708#M53207</link>
      <description>&lt;P&gt;It won't. That's not how the data is returned. If the role has access to individual indexes, they will show. It  is straight from the manager gui page.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 19:46:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184708#M53207</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-06-30T19:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184709#M53208</link>
      <description>&lt;P&gt;Your &lt;CODE&gt;can_delete&lt;/CODE&gt; role is likely not associated with any index, so a left join starting with your indexes isn't going to show it.&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/authentication/users | table title roles | rename title as user | mvexpand roles
| join type=left roles [rest /services/authorization/roles | table title srchIndexesAllowed srchIndexesDefault | rename title as roles]
| makemv srchIndexesAllowed tokenizer=(\S+) | makemv srchIndexesDefault tokenizer=(\S+) | stats values(*) as * by user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now with expanded &lt;CODE&gt;_*&lt;/CODE&gt; and &lt;CODE&gt;*&lt;/CODE&gt; indexes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/authentication/users | table title roles | rename title as user | mvexpand roles
| join type=left roles [rest /services/authorization/roles | table title srchIndexesAllowed srchIndexesDefault | rename title as roles]
| makemv srchIndexesAllowed tokenizer=(\S+) | makemv srchIndexesDefault tokenizer=(\S+)
| fillnull value=" "
| mvexpand srchIndexesAllowed | mvexpand srchIndexesDefault
| join type=left max=999 srchIndexesAllowed [rest /services/data/indexes | table title | eval srchIndexesAllowed = if(match(title, "^_"), "_*", "*") | rename title as IndexesAllowed]
| join type=left max=999 srchIndexesDefault [rest /services/data/indexes | table title | eval srchIndexesDefault = if(match(title, "^_"), "_*", "*") | rename title as IndexesDefault]
| stats values(*) as * by user
| foreach srch* [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = mvappend(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;) | eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = mvfilter(match(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "^[^*]+$"))]
| fields - Indexes*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184709#M53208</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-06-30T21:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184710#M53209</link>
      <description>&lt;P&gt;Don't combine searches, just take the one from my answer.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184710#M53209</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-06-30T21:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184711#M53210</link>
      <description>&lt;P&gt;I see... minor issue with &lt;CODE&gt;mvexpand&lt;/CODE&gt; and null values, I've replaced the search.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184711#M53210</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-06-30T21:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184712#M53211</link>
      <description>&lt;P&gt;I've added a slightly more verbose search that will expand &lt;CODE&gt;*&lt;/CODE&gt; and &lt;CODE&gt;_*&lt;/CODE&gt; into a list of indexes, give that a shot.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184712#M53211</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-06-30T21:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184713#M53212</link>
      <description>&lt;P&gt;So... you want to expand &lt;CODE&gt;*&lt;/CODE&gt; and &lt;CODE&gt;_*&lt;/CODE&gt; into a list of all non-internal / internal indexes?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184713#M53212</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-06-30T21:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184714#M53213</link>
      <description>&lt;P&gt;Martin,&lt;BR /&gt;
This new one you post, does not show the can_delete role, it showed all index and other roles &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rest /services/authentication/users | table title roles | rename title as user | mvexpand roles
| join type=left roles [rest /services/authorization/roles | table title srchIndexesAllowed srchIndexesDefault | rename title as roles]
| makemv srchIndexesAllowed tokenizer=(\S+) | makemv srchIndexesDefault tokenizer=(\S+)
| mvexpand srchIndexesAllowed | mvexpand srchIndexesDefault
| join type=left max=999 srchIndexesAllowed [rest /services/data/indexes | table title | eval srchIndexesAllowed = if(match(title, "^_"), "_*", "*") | rename title as IndexesAllowed]
| join type=left max=999 srchIndexesDefault [rest /services/data/indexes | table title | eval srchIndexesDefault = if(match(title, "^_"), "_*", "*") | rename title as IndexesDefault]
| stats values(*) as * by user
| foreach srch* [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = mvappend(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, &amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;) | eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = mvfilter(match(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "^[^*]+$"))]
| fields - Indexes*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184714#M53213</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2015-06-30T21:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184715#M53214</link>
      <description>&lt;P&gt;Thanks Martin! I try the new update search.  Now it does not list the can_delete role when combined  the search I posted with your search&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184715#M53214</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2015-06-30T21:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184716#M53215</link>
      <description>&lt;P&gt;Yes , I want it to expand and list all indexes.  From the search I posted . It showed like this&lt;BR /&gt;
index_name  Role    User&lt;BR /&gt;
_audit  admin   xyz&lt;BR /&gt;
_blocksignature     admin   xyz&lt;BR /&gt;
_internal   admin   xyz&lt;BR /&gt;
_internal   new_user_role   xyz&lt;BR /&gt;
_introspection  admin  xyz&lt;BR /&gt;
_thefishbucket  admin   xyz&lt;BR /&gt;
christine   admin   xyz&lt;BR /&gt;
christine   test_role   xyz&lt;BR /&gt;
christine_new   admin   xyz&lt;/P&gt;

&lt;H1&gt;but I do not have can_delete role &lt;/H1&gt;

&lt;P&gt;your query looks like this&lt;BR /&gt;
user    roles   srchIndexesAllowed  srchIndexesDefault&lt;BR /&gt;
xyz     admin   * _*                                  main os&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:25:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184716#M53215</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2020-09-28T20:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184717#M53216</link>
      <description>&lt;P&gt;Thanks! Your worked partially.   It showed all the role but not all indexes.  It does not showed index like _fishbucket, _audit , _blocksignature , _introspection  and user created indexes&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184717#M53216</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2015-06-30T21:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search a list of users with all the roles and indexes assigned?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184718#M53217</link>
      <description>&lt;P&gt;thanks Martin, It worked now :&amp;lt;).  You are the best&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 21:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-a-list-of-users-with-all-the-roles-and-indexes/m-p/184718#M53217</guid>
      <dc:creator>cdo_splunk</dc:creator>
      <dc:date>2015-06-30T21:46:32Z</dc:date>
    </item>
  </channel>
</rss>

