<?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: See what time range users search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378701#M111008</link>
    <description>&lt;P&gt;Ah, damn, I saw that, but forget to post it here. Sorry!&lt;/P&gt;</description>
    <pubDate>Wed, 02 May 2018 15:13:00 GMT</pubDate>
    <dc:creator>xpac</dc:creator>
    <dc:date>2018-05-02T15:13:00Z</dc:date>
    <item>
      <title>See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378695#M111002</link>
      <description>&lt;P&gt;I want to write a query to see what time range users are using in their searches. e.g. 90% of searches use the last 24 hours and 10% of searches use 1+ day ago for the time frame.&lt;/P&gt;

&lt;P&gt;I am using the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" action=search | eval searchExecutedTime = strptime(timestamp,"%m/%d/%Y") | eval searchTimeFrameStart = strptime(apiStartTime,"%m/%d/%Y") | eval past = searchExecutedTime - searchTimeFrameStart | table past
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I run this search it just opens to the statistics tab with an empty table but the tab shows that there are 2000+ results.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4895i63CD14D6FB6B71D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 15:19:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378695#M111002</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-05-01T15:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378696#M111003</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_audit" action=search search_id=* api_et=* api_lt=* | eval Past=tostring(round(api_lt-api_et),"duration") | stats count by Past
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 15:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378696#M111003</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-01T15:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378697#M111004</link>
      <description>&lt;P&gt;I just checked my audit log, and at least from what I see your timestamp format are completely off. &lt;CODE&gt;timestamp&lt;/CODE&gt; and &lt;CODE&gt;apiStartTime&lt;/CODE&gt; are in completely different formats, returning both fields as empty, resulting in &lt;CODE&gt;past&lt;/CODE&gt; being empty, and therefore getting an empty table with 2000+ lines, because in all events the &lt;CODE&gt;past&lt;/CODE&gt; field does not exist.&lt;/P&gt;

&lt;P&gt;If you fix your timestamp parsings, everything should be fine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Check the &lt;A href="http://strftime.org/"&gt;strftime.org documentation&lt;/A&gt; for an overview.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 15:45:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378697#M111004</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-01T15:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378698#M111005</link>
      <description>&lt;P&gt;Thank you very much. I think you found my problem (user error). I have been able to correct the timestamp extraction and that one is working great now. I am still unable to get results with the apiStartTime part though. Do you see anything wrong with it?&lt;/P&gt;

&lt;P&gt;Here is what I am trying to match and what I used:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sat Mar 31 00:00:00 2018
“%a %b %d %H:%M:%S %Y”
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 16:30:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378698#M111005</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-05-01T16:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378699#M111006</link>
      <description>&lt;P&gt;It needed single quotes included. "'%a...%Y'"&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378699#M111006</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-05-02T15:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378700#M111007</link>
      <description>&lt;P&gt;Thank you that was helpful. &lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378700#M111007</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-05-02T15:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378701#M111008</link>
      <description>&lt;P&gt;Ah, damn, I saw that, but forget to post it here. Sorry!&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:13:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378701#M111008</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-02T15:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: See what time range users search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378702#M111009</link>
      <description>&lt;P&gt;No worries, that was the info I needed and it got me straightened out. I appreciate it!&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 15:15:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/See-what-time-range-users-search/m-p/378702#M111009</guid>
      <dc:creator>dtow1</dc:creator>
      <dc:date>2018-05-02T15:15:17Z</dc:date>
    </item>
  </channel>
</rss>

