<?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: Convert Time Picker values in readable format..? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489381#M83673</link>
    <description>&lt;P&gt;Hi @vinothn,&lt;/P&gt;

&lt;P&gt;There is an exception while using &lt;STRONG&gt;eval&lt;/STRONG&gt; expression with function &lt;STRONG&gt;strftime()&lt;/STRONG&gt; to define token filtering for dashboards. It uses &lt;STRONG&gt;client (browser) time zone&lt;/STRONG&gt;. It will be better if you convert epoch to date time string search query itself then set fields to token.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;![&amp;lt;search&amp;gt;
     &amp;lt;query&amp;gt;
       |makeresults 
       | addinfo | eval info_min_datetime=strftime(info_min_time,"%Y-%m-%d %H:%M:%S %Z"), info_max_datetime=strftime(info_max_time,"%Y-%m-%d %H:%M:%S %Z")
     &amp;lt;/query&amp;gt;
     &amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;
     &amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;
     &amp;lt;done&amp;gt;
       &amp;lt;set token="Tearliest"&amp;gt;$result.info_min_datetime$&amp;lt;/set&amp;gt;
       &amp;lt;set token="Tlatest"&amp;gt;$result.info_max_datetime$&amp;lt;/set&amp;gt;
     &amp;lt;/done&amp;gt;
   &amp;lt;/search&amp;gt;][2]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 08 Mar 2020 15:16:19 GMT</pubDate>
    <dc:creator>manjunathmeti</dc:creator>
    <dc:date>2020-03-08T15:16:19Z</dc:date>
    <item>
      <title>Convert Time Picker values in readable format..?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489380#M83672</link>
      <description>&lt;P&gt;Based on the time picker &amp;amp; time modifier token i am displaying the time values in a human readable format in a label.&lt;/P&gt;

&lt;P&gt;For this command i am getting the proper results.&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/8512i0AC68CA18661F480/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval latest1="1583038799.000",earliest1="1567310400.000"
| eval latest2=strftime(latest1,"%Y-%m-%d %H:%M:%S"),earliest2=strftime(earliest1,"%Y-%m-%d %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But if i try it in time modifier i am not getting the same result i am not sure it is because of time zone ..?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;![&amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;
      |makeresults 
| addinfo
    &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;eval token="Tearliest"&amp;gt;strftime($result.info_min_time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="Tlatest"&amp;gt;strftime($result.info_max_time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;][2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both the places i am using the same code getting different results. any thoughts..&lt;BR /&gt;
Thanks in advance....&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 14:27:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489380#M83672</guid>
      <dc:creator>vinothn</dc:creator>
      <dc:date>2020-03-08T14:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time Picker values in readable format..?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489381#M83673</link>
      <description>&lt;P&gt;Hi @vinothn,&lt;/P&gt;

&lt;P&gt;There is an exception while using &lt;STRONG&gt;eval&lt;/STRONG&gt; expression with function &lt;STRONG&gt;strftime()&lt;/STRONG&gt; to define token filtering for dashboards. It uses &lt;STRONG&gt;client (browser) time zone&lt;/STRONG&gt;. It will be better if you convert epoch to date time string search query itself then set fields to token.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;![&amp;lt;search&amp;gt;
     &amp;lt;query&amp;gt;
       |makeresults 
       | addinfo | eval info_min_datetime=strftime(info_min_time,"%Y-%m-%d %H:%M:%S %Z"), info_max_datetime=strftime(info_max_time,"%Y-%m-%d %H:%M:%S %Z")
     &amp;lt;/query&amp;gt;
     &amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;
     &amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;
     &amp;lt;done&amp;gt;
       &amp;lt;set token="Tearliest"&amp;gt;$result.info_min_datetime$&amp;lt;/set&amp;gt;
       &amp;lt;set token="Tlatest"&amp;gt;$result.info_max_datetime$&amp;lt;/set&amp;gt;
     &amp;lt;/done&amp;gt;
   &amp;lt;/search&amp;gt;][2]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 Mar 2020 15:16:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489381#M83673</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-08T15:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time Picker values in readable format..?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489382#M83674</link>
      <description>&lt;P&gt;Thank you @manjunathmeti  the above answer is working.&lt;BR /&gt;
Still since my splunk instance is running on EST it is showing time stamp values in EST zone, but the users are from different zone is there any way to show the timestamp based on the user location.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 07:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489382#M83674</guid>
      <dc:creator>vinothn</dc:creator>
      <dc:date>2020-03-09T07:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Time Picker values in readable format..?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489383#M83675</link>
      <description>&lt;P&gt;hi @vinothn,&lt;/P&gt;

&lt;P&gt;You can eval expression like one in your question only.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;![&amp;lt;search&amp;gt;
     &amp;lt;query&amp;gt;
       |makeresults 
 | addinfo
     &amp;lt;/query&amp;gt;
     &amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;
     &amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;
     &amp;lt;done&amp;gt;
       &amp;lt;eval token="Tearliest"&amp;gt;strftime($result.info_min_time$,"%Y-%m-%d %H:%M:%S %z")&amp;lt;/eval&amp;gt;
       &amp;lt;eval token="Tlatest"&amp;gt;strftime($result.info_max_time$,"%Y-%m-%d %H:%M:%S %z")&amp;lt;/eval&amp;gt;
     &amp;lt;/done&amp;gt;
   &amp;lt;/search&amp;gt;][2]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 08:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-Time-Picker-values-in-readable-format/m-p/489383#M83675</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-09T08:10:31Z</dc:date>
    </item>
  </channel>
</rss>

