<?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: Get user's search history in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57754#M14093</link>
    <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2017 11:01:18 GMT</pubDate>
    <dc:creator>Branden</dc:creator>
    <dc:date>2017-01-27T11:01:18Z</dc:date>
    <item>
      <title>Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57744#M14083</link>
      <description>&lt;P&gt;Quick question: how can I view a user's search history? &lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2011 03:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57744#M14083</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2011-03-11T03:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57745#M14084</link>
      <description>&lt;P&gt;The solution for 5.x and later is to use the "history" command in search. Ie.&lt;/P&gt;

&lt;P&gt;| history&lt;/P&gt;

&lt;P&gt;See &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.5/SearchReference/History"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.5/SearchReference/History&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 16:20:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57745#M14084</guid>
      <dc:creator>Glenn</dc:creator>
      <dc:date>2013-10-07T16:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57746#M14085</link>
      <description>&lt;P&gt;It appears that "history" only returns search history for the current user. Is there a way in 5.x to get history for all users?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2013 20:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57746#M14085</guid>
      <dc:creator>joebensimo</dc:creator>
      <dc:date>2013-12-17T20:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57747#M14086</link>
      <description>&lt;P&gt;Also, "history" suffers from the same problem as the "Jobs" page: it doesn't contain the full history. Viewing a dashboard with an auto-refresh can quickly blow through all the history that is retained for "history".&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2013 21:52:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57747#M14086</guid>
      <dc:creator>joebensimo</dc:creator>
      <dc:date>2013-12-17T21:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57748#M14087</link>
      <description>&lt;P&gt;This thread came up in a search for something related. Figured I would share. Note having the double stats command in this context can get you in trouble if you have someone who has created a lot of searches. In general I like this method to display data in Splunk dashboards/views. Sucks when it is exported though. If nothing else everything up to the first pipe can be used. I'm wrapping the field and value components in quotes to make it a bit faster. The metadata search bit is from the default search page in 5x.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action=search info=granted search=* NOT "search_id='scheduler" NOT "search='|history" NOT "user=splunk-system-user" NOT "search='typeahead" NOT "search='| metadata type=* | search totalCount&amp;gt;0" | stats count by user search _time | sort _time | convert ctime(_time) | stats list(_time) as time list(search) as search by user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Feb 2014 13:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57748#M14087</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2014-02-12T13:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57749#M14088</link>
      <description>&lt;P&gt;This is what I was looking for.  Thanks!  Well, I modified it a bit to dumb it down, but this works to just see who is running what:&lt;BR /&gt;
index=_audit action=search earliest=@d user!="splunk-system-user" user!=admin | stats values(search) by user&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 18:06:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57749#M14088</guid>
      <dc:creator>proletariat99</dc:creator>
      <dc:date>2015-11-09T18:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57750#M14089</link>
      <description>&lt;P&gt;Thanks for the input here.  I found some odd results based on what a user says they were searching and what is reported out of the _audit index.  Anyway, here's another method I found that may or may not be applicable, but it seemed to at least yield some results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal user=* sourcetype=splunkd_ui_access | dedup q | table _time, q | eval q=urldecode(q)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it might also help.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 18:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57750#M14089</guid>
      <dc:creator>mparks11</dc:creator>
      <dc:date>2016-09-02T18:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57751#M14090</link>
      <description>&lt;P&gt;Thank you for the update!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 16:22:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57751#M14090</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2016-11-21T16:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57752#M14091</link>
      <description>&lt;P&gt;This post has a better solution:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/151378/why-history-command-only-shows-my-searches-not-searches-run-by-all-users.html" target="_blank"&gt;https://answers.splunk.com/answers/151378/why-history-command-only-shows-my-searches-not-searches-run-by-all-users.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
index=_audit action=search info=granted search=* NOT "search_id='scheduler" NOT "search='|history" NOT "user=splunk-system-user" NOT "search='typeahead" NOT "search='| metadata type=* | search totalCount&amp;gt;0" | stats count by user search _time | sort _time | convert ctime(_time) | stats list(_time) as time list(search) as search by user&lt;/P&gt;

&lt;P&gt;OR&lt;BR /&gt;
|history&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:33:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57752#M14091</guid>
      <dc:creator>bohanlon_splunk</dc:creator>
      <dc:date>2020-09-29T12:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57753#M14092</link>
      <description>&lt;P&gt;Converting this answer to a comment, since it doesn't work as of Splunk 5.x, so that other correct answers will show up first. &lt;/P&gt;

&lt;P&gt;You can do a search for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=searches username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57753#M14092</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2017-01-27T11:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57754#M14093</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57754#M14093</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2017-01-27T11:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57755#M14094</link>
      <description>&lt;P&gt;I downvoted this post because doesn't work in 6.5.x either.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57755#M14094</guid>
      <dc:creator>bohanlon_splunk</dc:creator>
      <dc:date>2017-01-27T11:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57756#M14095</link>
      <description>&lt;P&gt;This solution doesn't work&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57756#M14095</guid>
      <dc:creator>alanden_splunk</dc:creator>
      <dc:date>2017-01-27T11:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57757#M14096</link>
      <description>&lt;P&gt;This no longer works with 5.x.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57757#M14096</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2017-01-27T11:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57758#M14097</link>
      <description>&lt;P&gt;My pleasure!  .&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 11:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57758#M14097</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2017-01-27T11:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57759#M14098</link>
      <description>&lt;P&gt;Which is a search originally posted in this thread &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57759#M14098</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2017-01-27T13:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57760#M14099</link>
      <description>&lt;P&gt;Good call everyone! You should use &lt;CODE&gt;index=_internal action=search search=*&lt;/CODE&gt; now. Or download the Search Activity app &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;A href="https://splunkbase.splunk.com/app/2632/"&gt;https://splunkbase.splunk.com/app/2632/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 15:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57760#M14099</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2017-02-06T15:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57761#M14100</link>
      <description>&lt;P&gt;This works great, but i do notice that all the dashboard searches that fire when a user hits a certain dashboard also go into the list under their name. Is there something i could add to the query to remove the dashboard triggered searches, and return ONLY searches triggered manually by a user?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 16:19:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57761#M14100</guid>
      <dc:creator>dmcgeearke</dc:creator>
      <dc:date>2018-11-13T16:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57762#M14101</link>
      <description>&lt;P&gt;Also, I'd like to be able to use the $click.value2$ to do a drilldown search, but it seems to be adding the single quotes before and after the search. Any ideas on how to remove those from the search query, either before displaying it, or on the drilldown?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 16:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57762#M14101</guid>
      <dc:creator>dmcgeearke</dc:creator>
      <dc:date>2018-11-13T16:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get user's search history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57763#M14102</link>
      <description>&lt;P&gt;There's probably a more elegant way, but this should work to remove the single quotes in your results, by appending to the end of your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=search mode=sed "s/^'//g"
| rex field=search mode=sed "s/'$//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Nov 2018 19:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-user-s-search-history/m-p/57763#M14102</guid>
      <dc:creator>mparks11</dc:creator>
      <dc:date>2018-11-13T19:51:39Z</dc:date>
    </item>
  </channel>
</rss>

