<?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 List all created users with their roles. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/List-all-created-users-with-their-roles/m-p/480273#M192967</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to see roles of created users not roles of user which created account, is there a way to to this? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action=edit_user operation=create 
| eval timestamp_formated=strptime(timestamp, "%m-%d-%Y %H:%M:%S.%3N") 
| convert timeformat="%d/%b/%Y" ctime(timestamp_formated)
| eval timestamp = strptime(timestamp, "%m-%d-%Y %H:%M:%S.%3N")
| join user 
    [| rest /services/authentication/users 
    | fields title roles 
    | rename title AS user ]
| rename object as created_user, user as created_by
| stats  values(roles) as user_roles values(timestamp) as timestamp values(host) as created_on by timestamp_formated created_user created_by 
| sort - timestamp
| fields - timestamp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 28 Feb 2020 10:41:23 GMT</pubDate>
    <dc:creator>omateusz</dc:creator>
    <dc:date>2020-02-28T10:41:23Z</dc:date>
    <item>
      <title>List all created users with their roles.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-all-created-users-with-their-roles/m-p/480273#M192967</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to see roles of created users not roles of user which created account, is there a way to to this? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action=edit_user operation=create 
| eval timestamp_formated=strptime(timestamp, "%m-%d-%Y %H:%M:%S.%3N") 
| convert timeformat="%d/%b/%Y" ctime(timestamp_formated)
| eval timestamp = strptime(timestamp, "%m-%d-%Y %H:%M:%S.%3N")
| join user 
    [| rest /services/authentication/users 
    | fields title roles 
    | rename title AS user ]
| rename object as created_user, user as created_by
| stats  values(roles) as user_roles values(timestamp) as timestamp values(host) as created_on by timestamp_formated created_user created_by 
| sort - timestamp
| fields - timestamp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 10:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-all-created-users-with-their-roles/m-p/480273#M192967</guid>
      <dc:creator>omateusz</dc:creator>
      <dc:date>2020-02-28T10:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: List all created users with their roles.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-all-created-users-with-their-roles/m-p/480274#M192968</link>
      <description>&lt;P&gt;You're joining on the field &lt;CODE&gt;user&lt;/CODE&gt;, which is the creating user in your audit logs - the created user is in the field &lt;CODE&gt;object&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Change your rename to &lt;CODE&gt;AS object&lt;/CODE&gt; inside the join, and join on &lt;CODE&gt;object&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Feb 2020 22:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-all-created-users-with-their-roles/m-p/480274#M192968</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2020-02-29T22:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: List all created users with their roles.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/List-all-created-users-with-their-roles/m-p/480275#M192969</link>
      <description>&lt;P&gt;Here is how we audit and figure out who is able to do what and slowly remove those who don't need it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest/services/authentication/users
| dedup id
| rename title AS username roles AS role_direct
| mvexpand role_direct
| eval user=username . " = " . realname
| fields user role_direct
| appendpipe [
| rest/services/authorization/roles
| dedup id
| rename title AS role_direct
| eval role_add = role_direct
| eval combined_roles=mvappend(role_add,imported_roles)
| mvexpand combined_roles 
| fields role_direct, combined_roles]
| stats list(*) AS * BY role_direct
| mvexpand combined_roles
| rename combined_roles AS combined_role
| eval formatted_role=if(combined_role = role_direct,combined_role." (direct assignment)",combined_role." (inherited through ".role_direct.")")
| appendpipe [
| rest /services/authorization/roles 
| dedup id
| rename title AS combined_role
| fields combined_role capabilities]
| stats list(*) AS * BY combined_role
| mvexpand formatted_role
| mvexpand capabilities
| mvexpand user
| rename capabilities AS capability
| rename formatted_role AS "role (inheritance)"
| table user "role (inheritance)" capability
| search capability="edit_user"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Feb 2020 22:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/List-all-created-users-with-their-roles/m-p/480275#M192969</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-02-29T22:16:40Z</dc:date>
    </item>
  </channel>
</rss>

