<?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 get time picker earliest and latest epoch values before doing a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199829#M57894</link>
    <description>&lt;P&gt;I don't want to fire a job for one simple search.&lt;/P&gt;

&lt;P&gt;This could take some seconds. With JS I get the answers in 20ms.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2016 10:57:55 GMT</pubDate>
    <dc:creator>lukasz92</dc:creator>
    <dc:date>2016-02-05T10:57:55Z</dc:date>
    <item>
      <title>How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199823#M57888</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;How can I get 'raw' earliest and latest value before doing search?&lt;/P&gt;

&lt;P&gt;I need the epoch seconds format, so &lt;CODE&gt;-1d@d&lt;/CODE&gt; could be converted to 1450696447.&lt;BR /&gt;
I know the addinfo command, but for my custom visualization, I need to know it &lt;STRONG&gt;before&lt;/STRONG&gt; starting a search (the search string depends on time difference).&lt;/P&gt;

&lt;P&gt;Where can I find Splunk timeformat parser in JavaScript?&lt;BR /&gt;
I know it exists, because there is dynamic evaluation here: &lt;A href="http://s29.postimg.org/ha258ed1z/Bez_nazwy.png"&gt;http://s29.postimg.org/ha258ed1z/Bez_nazwy.png&lt;/A&gt; in each Splunk timepicker&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 15:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199823#M57888</guid>
      <dc:creator>lukasz92</dc:creator>
      <dc:date>2015-12-22T15:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199824#M57889</link>
      <description>&lt;P&gt;It's unclear where you need the raw values - your custom viz needs the epoch value? Or does the search string need the epoch value? &lt;/P&gt;

&lt;P&gt;For Splunk have a look at the Splunk eval functions relative_time() and  strptime() &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/SearchReference/CommonEvalFunctions&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;If you want to do it in JS use something like &lt;CODE&gt;var epoch = Math.floor((new Date).getTime()/1000)&lt;/CODE&gt; (or see stack overflow for dozens of variations)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 15:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199824#M57889</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-12-30T15:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199825#M57890</link>
      <description>&lt;P&gt;I can't write condition  _time&amp;lt;30d@d - that is the reason.&lt;BR /&gt;
I also don't want to start new search for just parsing timestamps (it has to be fast).&lt;/P&gt;

&lt;P&gt;my solution includes &lt;CODE&gt;'models/services/search/TimeParser'&lt;/CODE&gt;.&lt;BR /&gt;
&lt;CODE&gt;resp_obj = (new TimeParser()).sync('read', TimeParser, {data: {time: arg}})&lt;/CODE&gt;      (arg is the string I want to parse)&lt;BR /&gt;
and after some time&lt;BR /&gt;
&lt;CODE&gt;Math.Floor((new Date(resp_obj.responseJSON[arg])).getTime() / 1000)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 11:45:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199825#M57890</guid>
      <dc:creator>lukasz92</dc:creator>
      <dc:date>2016-01-05T11:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199826#M57891</link>
      <description>&lt;P&gt;If you have found a solution would you mind posting it as an answer here and accepting it? That way the whole community benefits. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 11:54:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199826#M57891</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-01-05T11:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199827#M57892</link>
      <description>&lt;P&gt;How about &lt;CODE&gt;gentimes&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Gentimes"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Gentimes&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 02:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199827#M57892</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-01-07T02:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199828#M57893</link>
      <description>&lt;P&gt;My solution includes 'models/services/search/TimeParser'.&lt;BR /&gt;
&lt;CODE&gt;resp_obj = (new TimeParser()).sync('read', TimeParser, {data: {time: arg}});&lt;/CODE&gt; // (arg is the string I want to parse)&lt;BR /&gt;
Then, after some time - (I don't know how to attach handler for reply from TimeParser query.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Math.Floor((new Date(resp_obj.responseJSON[arg])).getTime() / 1000);&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I just looped this with setTimeout.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 10:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199828#M57893</guid>
      <dc:creator>lukasz92</dc:creator>
      <dc:date>2016-02-05T10:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199829#M57894</link>
      <description>&lt;P&gt;I don't want to fire a job for one simple search.&lt;/P&gt;

&lt;P&gt;This could take some seconds. With JS I get the answers in 20ms.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 10:57:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199829#M57894</guid>
      <dc:creator>lukasz92</dc:creator>
      <dc:date>2016-02-05T10:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199830#M57895</link>
      <description>&lt;P&gt;Thanks for updating the answer!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 11:20:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199830#M57895</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-02-05T11:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199831#M57896</link>
      <description>&lt;P&gt;I managed to do it using the   &lt;CODE&gt;relative_time&lt;/CODE&gt; function for use in a dashboard with a timepicker input.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;| loadjob savedsearch="foo:bar:buzz" | eval start_time=relative_time(now(),"$token_time.earliest$") | eval end_time=relative_time(now(),"$token_time.latest$") | where _time&amp;gt;=start_time AND _time&amp;lt;=end_time &amp;lt;/query&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;HTH&lt;BR /&gt;
Keith&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 06:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199831#M57896</guid>
      <dc:creator>kmugglet</dc:creator>
      <dc:date>2016-07-01T06:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199832#M57897</link>
      <description>&lt;P&gt;Umm this isn't about loadjob is it......... DOH&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 06:16:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199832#M57897</guid>
      <dc:creator>kmugglet</dc:creator>
      <dc:date>2016-07-01T06:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get time picker earliest and latest epoch values before doing a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199833#M57898</link>
      <description>&lt;P&gt;Hi @lukasz92 ,&lt;BR /&gt;
I have similar issue. I want to convert time picker value to epoch time so that i can put condition.  Could you please elaborate more, how you this solution fixed your issue.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 17:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-time-picker-earliest-and-latest-epoch-values/m-p/199833#M57898</guid>
      <dc:creator>twh1</dc:creator>
      <dc:date>2018-10-03T17:27:00Z</dc:date>
    </item>
  </channel>
</rss>

