<?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 Time comparison - Relative and Explict in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-comparison-Relative-and-Explict/m-p/755193#M59250</link>
    <description>&lt;P&gt;I have a field which gives when a particular event started. Depending on time period selected in dashboard , i want to fetch all records past that time period selected in time picker input of the dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem is if time input is relative like "today" /"Yesterday" choice 1 below works and i get results. When time selected as input is explicit like "10/02/2025"&amp;nbsp; ,choice 2 works and i get results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relative time logic :&lt;/P&gt;&lt;P&gt;|where timestamp2 &amp;gt;= relative_time(now(), "$field1.earliest$")&lt;/P&gt;&lt;P&gt;Explicit time logic :&lt;/P&gt;&lt;P&gt;|where timestamp2 &amp;gt;= tonumber("$field1.earliest$")&lt;/P&gt;&lt;P&gt;&amp;nbsp; How to enhance this ,so that irrespective of input ,will get results.&lt;/P&gt;&lt;P&gt;Something like below does not work :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;!--   ScriptorStartFragment   --&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN&gt;| eval earliest_time=if(isnum("$field1.earliest$"), tonumber("$field1.earliest$"), relative_time(now(), "$field1.earliest$"))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN&gt;| where&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;timestamp2 &amp;gt;= earliest_time&lt;!--   ScriptorEndFragment   --&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 05 Nov 2025 06:07:15 GMT</pubDate>
    <dc:creator>manas</dc:creator>
    <dc:date>2025-11-05T06:07:15Z</dc:date>
    <item>
      <title>Time comparison - Relative and Explict</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-comparison-Relative-and-Explict/m-p/755193#M59250</link>
      <description>&lt;P&gt;I have a field which gives when a particular event started. Depending on time period selected in dashboard , i want to fetch all records past that time period selected in time picker input of the dashboard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem is if time input is relative like "today" /"Yesterday" choice 1 below works and i get results. When time selected as input is explicit like "10/02/2025"&amp;nbsp; ,choice 2 works and i get results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relative time logic :&lt;/P&gt;&lt;P&gt;|where timestamp2 &amp;gt;= relative_time(now(), "$field1.earliest$")&lt;/P&gt;&lt;P&gt;Explicit time logic :&lt;/P&gt;&lt;P&gt;|where timestamp2 &amp;gt;= tonumber("$field1.earliest$")&lt;/P&gt;&lt;P&gt;&amp;nbsp; How to enhance this ,so that irrespective of input ,will get results.&lt;/P&gt;&lt;P&gt;Something like below does not work :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;!--   ScriptorStartFragment   --&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN&gt;| eval earliest_time=if(isnum("$field1.earliest$"), tonumber("$field1.earliest$"), relative_time(now(), "$field1.earliest$"))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN&gt;| where&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;timestamp2 &amp;gt;= earliest_time&lt;!--   ScriptorEndFragment   --&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Nov 2025 06:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Time-comparison-Relative-and-Explict/m-p/755193#M59250</guid>
      <dc:creator>manas</dc:creator>
      <dc:date>2025-11-05T06:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Time comparison - Relative and Explict</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-comparison-Relative-and-Explict/m-p/755200#M59251</link>
      <description>&lt;P&gt;Possibly the simplest answer is to let Splunk do it for you. You can use addinfo to get the search time settings and use them in your search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| addinfo
| where timestamp2 &amp;gt;= info_min_time&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 Nov 2025 09:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Time-comparison-Relative-and-Explict/m-p/755200#M59251</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-11-05T09:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Time comparison - Relative and Explict</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Time-comparison-Relative-and-Explict/m-p/755226#M59253</link>
      <description>&lt;P&gt;This works . Thanks . I have multiple time pickers in dashboard as it's a comparison dashboard as given each widget has it's own time picker ,it works regardless.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 15:08:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Time-comparison-Relative-and-Explict/m-p/755226#M59253</guid>
      <dc:creator>manas</dc:creator>
      <dc:date>2025-11-05T15:08:10Z</dc:date>
    </item>
  </channel>
</rss>

