<?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: Issue with strftime, strptime used in token eval and microseconds in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475289#M31201</link>
    <description>&lt;P&gt;After some tests, I am able to search by milliseconds intervals&lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2020 15:53:17 GMT</pubDate>
    <dc:creator>damienschmitt</dc:creator>
    <dc:date>2020-04-13T15:53:17Z</dc:date>
    <item>
      <title>Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475285#M31197</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I try to use a token from a drilldown in a previous view in my app. The token contain a date in this format: "%Y-%m-%d %H:%M:%S.%6Q" (possible to update the format but I need to show microseconds).&lt;/P&gt;

&lt;P&gt;I used this code to change the format according to earliest and latest :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="text" token="earliest"&amp;gt;
      &amp;lt;label&amp;gt;earliest&amp;lt;/label&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="earliest_clean"&amp;gt;strftime(strptime($value$,"%Y-%m-%d %H:%M:%S.%6Q"),"%m-%d-%y %H:%M:%S.%6Q")&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="latest"&amp;gt;
      &amp;lt;label&amp;gt;latest&amp;lt;/label&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="latest_clean"&amp;gt;strftime(strptime($value$,"%Y-%m-%d %H:%M:%S.%6Q"),"%m-%d-%y %H:%M:%S.%6Q")&amp;lt;/eval&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried to use %3Q %Q %6N %3N, nothing works. The best result is using %3N, the function works but the result is wrong (milliseconds are missing after conversion):&lt;/P&gt;

&lt;P&gt;2020-04-12 21:34:41.268 =&amp;gt; 2020-04-12 21:34:41.000&lt;/P&gt;

&lt;P&gt;Any idea to solve this issue ?&lt;/P&gt;

&lt;P&gt;After solving this issue, I will need to solve another problem: Splunk is unable to search on same date/time. How to limit my search to a single microsecond ? If there is no other option, how can I add one microsecond to latest ?&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 23:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475285#M31197</guid>
      <dc:creator>damienschmitt</dc:creator>
      <dc:date>2020-04-12T23:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475286#M31198</link>
      <description>&lt;P&gt;why don't you use epoch with token, and change to string in query?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 09:23:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475286#M31198</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-13T09:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475287#M31199</link>
      <description>&lt;P&gt;Splunk event timestamps have 1-second resolution.  One cannot search time periods smaller than a second.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 12:43:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475287#M31199</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-13T12:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475288#M31200</link>
      <description>&lt;P&gt;I tried with epoch (sending _time from the table in the previous view) but I am unable to add one more milliseconds to latest.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="text" token="earliest"&amp;gt;
      &amp;lt;label&amp;gt;earliest&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="latest"&amp;gt;
      &amp;lt;label&amp;gt;latest&amp;lt;/label&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;eval token="latest"&amp;gt;$value$&amp;lt;/eval&amp;gt; &amp;lt;= don't know how to add one more millisecond here
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The query result with &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Invalid latest_time: latest_time must&lt;BR /&gt;
be after earliest_time&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:00:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475288#M31200</guid>
      <dc:creator>damienschmitt</dc:creator>
      <dc:date>2020-09-30T05:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475289#M31201</link>
      <description>&lt;P&gt;After some tests, I am able to search by milliseconds intervals&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 15:53:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475289#M31201</guid>
      <dc:creator>damienschmitt</dc:creator>
      <dc:date>2020-04-13T15:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475290#M31202</link>
      <description>&lt;P&gt;Please share how you did that.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 17:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475290#M31202</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-13T17:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475291#M31203</link>
      <description>&lt;P&gt;I used two tokens with this format for earliest and latest: 2020-04-12T21:34:41.611+00:00&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=$index$&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Apr 2020 19:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475291#M31203</guid>
      <dc:creator>damienschmitt</dc:creator>
      <dc:date>2020-04-13T19:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with strftime, strptime used in token eval and microseconds</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475292#M31204</link>
      <description>&lt;P&gt;Have you tried using directly epoch format in your form? To strptime/strftime may truncate your timestamp.&lt;BR /&gt;
Then you can add a microsecond to it simply with a sum ($value$+0.001) and it should work.&lt;/P&gt;

&lt;P&gt;To directly use epoch, you must do a &lt;CODE&gt;|eval var=_time&lt;/CODE&gt; and use var. Because the _time field is modified to be readable when the field is printed on screen&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 10:17:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Issue-with-strftime-strptime-used-in-token-eval-and-microseconds/m-p/475292#M31204</guid>
      <dc:creator>Scrutch</dc:creator>
      <dc:date>2020-04-14T10:17:47Z</dc:date>
    </item>
  </channel>
</rss>

