<?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: Splunk - timestamp conversion for dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-timestamp-conversion-for-dashboard/m-p/366394#M41688</link>
    <description>&lt;P&gt;When I have date stamps in my lookup files and want to filter results based on date, I don't use the time tokens, because there are so many variations and edge cases. Instead, I do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| addinfo
| where info_min_time&amp;lt;=whatever_start_date_time AND info_max_time&amp;gt;=whatever_end_time
| fields - info_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;addinfo&lt;/CODE&gt; command will add four fields to every event - &lt;CODE&gt;info_max_time&lt;/CODE&gt; (equivalent to the $latest$ token, but always in epoch format), &lt;CODE&gt;info_min_time&lt;/CODE&gt; (equivalent to the $earliest$ token, but always in epoch format), &lt;CODE&gt;info_search_time&lt;/CODE&gt; (when the search was run), and &lt;CODE&gt;info_sid&lt;/CODE&gt; (a unique ID assigned to the search).&lt;/P&gt;

&lt;P&gt;The line &lt;CODE&gt;| fields - info_*&lt;/CODE&gt; is just to remove those fields after I've used them for comparisons.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2018 14:14:28 GMT</pubDate>
    <dc:creator>elliotproebstel</dc:creator>
    <dc:date>2018-04-27T14:14:28Z</dc:date>
    <item>
      <title>Splunk - timestamp conversion for dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-timestamp-conversion-for-dashboard/m-p/366393#M41687</link>
      <description>&lt;P&gt;Hi, I have a lookup table which has the list of email id's and the dates they logged into the application as below, &lt;/P&gt;

&lt;P&gt;Username                         time&lt;BR /&gt;
&lt;A href="mailto:testuser1@gmail.com"&gt;testuser1@gmail.com&lt;/A&gt;    03/31/2018&lt;BR /&gt;
&lt;A href="mailto:testuser2@gmail.com"&gt;testuser2@gmail.com&lt;/A&gt;    03/30/2018&lt;/P&gt;

&lt;P&gt;if I use the date range on the Splunk dashboard, the query is working without any issue, because it shows the timestamp on the query, but if I choose the present timeframe such as last 1 day, last 30 minutes, it is populating as now and -15m, I'm unable to convert the time format,  Could anyone please help me to resolve the issue?&lt;/P&gt;

&lt;P&gt;Query Format - &lt;BR /&gt;
| eval mytime1=strftime($time.latest$,"%Y%m%d") &lt;BR /&gt;
| eval mytime2=strftime($time.earliest$,"%Y%m%d") &lt;BR /&gt;
| where mytime &amp;lt;= mytime1 and mytime &amp;gt;= mytime2&lt;/P&gt;

&lt;P&gt;Present time frame-&lt;BR /&gt;
| eval mytime1=strftime(now,"%Y%m%d") &lt;BR /&gt;
| eval mytime2=strftime(-15m,"%Y%m%d") &lt;BR /&gt;
| where mytime &amp;lt;= mytime1 and mytime &amp;gt;= mytime2&lt;/P&gt;

&lt;P&gt;Date range - &lt;BR /&gt;
| eval mytime1=strftime(1516942800,"%Y%m%d") &lt;BR /&gt;
| eval mytime2=strftime(1514782800,"%Y%m%d") &lt;BR /&gt;
| where mytime &amp;lt;= mytime1 and mytime &amp;gt;= mytime2&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Dhana&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 13:35:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-timestamp-conversion-for-dashboard/m-p/366393#M41687</guid>
      <dc:creator>dhanasekarjanak</dc:creator>
      <dc:date>2018-04-27T13:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk - timestamp conversion for dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-timestamp-conversion-for-dashboard/m-p/366394#M41688</link>
      <description>&lt;P&gt;When I have date stamps in my lookup files and want to filter results based on date, I don't use the time tokens, because there are so many variations and edge cases. Instead, I do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| addinfo
| where info_min_time&amp;lt;=whatever_start_date_time AND info_max_time&amp;gt;=whatever_end_time
| fields - info_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;addinfo&lt;/CODE&gt; command will add four fields to every event - &lt;CODE&gt;info_max_time&lt;/CODE&gt; (equivalent to the $latest$ token, but always in epoch format), &lt;CODE&gt;info_min_time&lt;/CODE&gt; (equivalent to the $earliest$ token, but always in epoch format), &lt;CODE&gt;info_search_time&lt;/CODE&gt; (when the search was run), and &lt;CODE&gt;info_sid&lt;/CODE&gt; (a unique ID assigned to the search).&lt;/P&gt;

&lt;P&gt;The line &lt;CODE&gt;| fields - info_*&lt;/CODE&gt; is just to remove those fields after I've used them for comparisons.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-timestamp-conversion-for-dashboard/m-p/366394#M41688</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-27T14:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk - timestamp conversion for dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-timestamp-conversion-for-dashboard/m-p/366395#M41689</link>
      <description>&lt;P&gt;Thank you so much! it worked. &lt;/P&gt;

&lt;P&gt;Dhana&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 15:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-timestamp-conversion-for-dashboard/m-p/366395#M41689</guid>
      <dc:creator>dhanasekarjanak</dc:creator>
      <dc:date>2018-04-27T15:46:44Z</dc:date>
    </item>
  </channel>
</rss>

