<?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 use rex to extract the time stamp of a used search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260528#M78145</link>
    <description>&lt;P&gt;Are searches time stamped when they are initiated? If they are where is that time stamp saved, maybe I can write up a script to draw it out?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ernie&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2016 19:14:27 GMT</pubDate>
    <dc:creator>ECovell</dc:creator>
    <dc:date>2016-09-20T19:14:27Z</dc:date>
    <item>
      <title>How can I use rex to extract the time stamp of a used search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260522#M78139</link>
      <description>&lt;P&gt;I am attempting to create a search that would pull information about search usage. I have an index generated off of this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/-/saved/searches splunk_server=local
| rename "eai:acl.app" AS app
| rename "eai:acl.owner" AS owner
| table title,app,owner
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have searched and cannot find a way to add a time stamp for searches.&lt;/P&gt;

&lt;P&gt;Thanks for your help,&lt;BR /&gt;
Ernie&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 19:22:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260522#M78139</guid>
      <dc:creator>ECovell</dc:creator>
      <dc:date>2016-08-29T19:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use rex to extract the time stamp of a used search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260523#M78140</link>
      <description>&lt;P&gt;Hi Ernie,&lt;BR /&gt;
have you taken a look at &lt;A href="https://splunkbase.splunk.com/app/2632/" target="_blank"&gt;this app&lt;/A&gt; yet? It may contain all the things you are trying to build, and then some.&lt;/P&gt;

&lt;P&gt;I don't believe the REST endpoint will capture the last run time of each search, if that is what you are after. For getting that, you will have to search index=_audit similar to this (will need tweaking): &lt;CODE&gt;index=_audit action=search savedsearch_name="*" | stats latest(_time) as LastRun by savedsearch_name | convert ctime(LastRun)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I would definitely take a look at the app mentioned above, if only to give you an idea of where to find the relevant data for your use case.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:46:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260523#M78140</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2020-09-29T10:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use rex to extract the time stamp of a used search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260524#M78141</link>
      <description>&lt;P&gt;This search works really well, but all I get is the scheduled searches that populate. I run a lot of different searches manually and they do not show up in this report. Any other suggestions?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ernie&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260524#M78141</guid>
      <dc:creator>ECovell</dc:creator>
      <dc:date>2016-09-02T14:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use rex to extract the time stamp of a used search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260525#M78142</link>
      <description>&lt;P&gt;you can write a particulear user-name &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action=search user=user-name | stats latest(_time) as LastRun by user | convert ctime(LastRun)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or, for all usernames (without splunk-system-user and splunk_alert_scheduler, the saved search user accounts)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action=search user!=splunk* | stats latest(_time) as LastRun by user | convert ctime(LastRun)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:49:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260525#M78142</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-09-29T10:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use rex to extract the time stamp of a used search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260526#M78143</link>
      <description>&lt;P&gt;Sorry, your initial question suggested you are only interested in finding saved search information. You can remove savedsearch_name="*" from the search string and find a different field to group by to include all search activity, as @inventsekar points out below.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 16:21:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260526#M78143</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2016-09-02T16:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use rex to extract the time stamp of a used search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260527#M78144</link>
      <description>&lt;P&gt;I have tried all different variations of searches, but I still get only the saved searches and not all the searches run. Is there a file that I can rip some of that info from? Is there some other search format I can try other than rest or index=audit source=audittrail?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ernie&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 13:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260527#M78144</guid>
      <dc:creator>ECovell</dc:creator>
      <dc:date>2016-09-12T13:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use rex to extract the time stamp of a used search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260528#M78145</link>
      <description>&lt;P&gt;Are searches time stamped when they are initiated? If they are where is that time stamp saved, maybe I can write up a script to draw it out?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ernie&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 19:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-rex-to-extract-the-time-stamp-of-a-used-search/m-p/260528#M78145</guid>
      <dc:creator>ECovell</dc:creator>
      <dc:date>2016-09-20T19:14:27Z</dc:date>
    </item>
  </channel>
</rss>

