<?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 to query for users using Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48459#M11571</link>
    <description>&lt;P&gt;By "search forwarder" do you mean distributed search head?  If so, I've updated the answer with some details to get you started on modifying the dashboard search to query all indexers.&lt;/P&gt;</description>
    <pubDate>Sat, 11 Sep 2010 09:46:20 GMT</pubDate>
    <dc:creator>hulahoop</dc:creator>
    <dc:date>2010-09-11T09:46:20Z</dc:date>
    <item>
      <title>how to query for users using Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48456#M11568</link>
      <description>&lt;P&gt;This should be an easy one, how do I get a list of my top users accessing Splunk?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2010 05:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48456#M11568</guid>
      <dc:creator>tedder</dc:creator>
      <dc:date>2010-09-11T05:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to query for users using Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48457#M11569</link>
      <description>&lt;P&gt;In the Search App there is a dashboard showing:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Today's Usage by User&lt;/LI&gt;
&lt;LI&gt;Yesterday's Usage by User&lt;/LI&gt;
&lt;LI&gt;Last 7 days Usage by User&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The dashboard is located under Status &amp;gt; Search activity &amp;gt; User activity.&lt;/P&gt;

&lt;P&gt;Is this what you are looking for?&lt;/P&gt;

&lt;P&gt;To make this work on a distirbuted search head I believe you'll have to modify the actual search.  The searches which drive these dashboard panels are located in $SPLUNK_HOME/etc/apps/search/default/data/ui/views/search_user_activity.xml.  Examine the first search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`audit_searchlocal` | `audit_rexsearch` | search search_id!=scheduler_* | convert num(total_run_time) | eval user = if(user="n/a", null(), user) | stats min(_time) as _time first(user) as user max(total_run_time) as total_run_time first(search) as search by search_id | search search=search* search!=*_internal* search!=*_audit* | chart median(total_run_time) as "Median search time" perc95(total_run_time) as "95th Percentile search time" sum(total_run_time) as "Total search time" count as "Search count" by user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search references 2 macros defined in $SPLUNK_HOME/etc/apps/search/default/macros.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[audit_searchlocal(1)]
args = filter
definition = search splunk_server=local index=_audit action=search (id=* OR search_id=*) | eval search_id = if(isnull(search_id), id, search_id) | replace '*' with * in search_id | search $filter$

[audit_rexsearch]
definition = rex "search='(?&amp;lt;search&amp;gt;.*?)', autojoin"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can see in the audit_searchlocal macro, the local splunk server is the only one queried, probably why you are not seeing any results when running this on a distributed search head.  Try removing "splunk_server=local" and see if you get any results.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2010 07:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48457#M11569</guid>
      <dc:creator>hulahoop</dc:creator>
      <dc:date>2010-09-11T07:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to query for users using Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48458#M11570</link>
      <description>&lt;P&gt;those are what I needed, but they are empty. I had to go to a specific indexer rather than the search forwarder. Is there a way to get the rolled-up results?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2010 09:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48458#M11570</guid>
      <dc:creator>tedder</dc:creator>
      <dc:date>2010-09-11T09:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to query for users using Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48459#M11571</link>
      <description>&lt;P&gt;By "search forwarder" do you mean distributed search head?  If so, I've updated the answer with some details to get you started on modifying the dashboard search to query all indexers.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2010 09:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48459#M11571</guid>
      <dc:creator>hulahoop</dc:creator>
      <dc:date>2010-09-11T09:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to query for users using Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48460#M11572</link>
      <description>&lt;P&gt;I have same problem, the result is empty &lt;BR /&gt;
&lt;CODE&gt;audit_searchlocal&lt;/CODE&gt; | timechart sum(total_run_time)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:20:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-query-for-users-using-Splunk/m-p/48460#M11572</guid>
      <dc:creator>mplaksin</dc:creator>
      <dc:date>2020-09-29T09:20:21Z</dc:date>
    </item>
  </channel>
</rss>

