<?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: Dynamic date comparison in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-date-comparison/m-p/552438#M156799</link>
    <description>&lt;P&gt;Not the difference, but using the app-release-date (past date) using this as the most recent date and use that as the starting point for this condition&lt;/P&gt;&lt;P&gt;[substitute the most recent as app-release-date]&lt;/P&gt;&lt;P&gt;The most recent = Green&lt;/P&gt;&lt;P&gt;Most recent – 7 days = yellow&lt;/P&gt;&lt;P&gt;Most recent – 30 days = red&lt;/P&gt;&lt;P&gt;Most recent &amp;nbsp;&amp;gt; 30 days = black&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 18:12:20 GMT</pubDate>
    <dc:creator>RonD</dc:creator>
    <dc:date>2021-05-20T18:12:20Z</dc:date>
    <item>
      <title>Dynamic date comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-date-comparison/m-p/552397#M156787</link>
      <description>&lt;P&gt;I am creating a search that detects compliance received from palo alto signatures&lt;/P&gt;&lt;P&gt;we are receving 4 sets of dates:&lt;/P&gt;&lt;P&gt;app-release-date&lt;/P&gt;&lt;P&gt;av-release-date&lt;/P&gt;&lt;P&gt;wildfire-release-date&lt;/P&gt;&lt;P&gt;threat-release-date&lt;/P&gt;&lt;P&gt;one of these dates (app-release-date) does not get updated daily, meaning&amp;nbsp; if today's date is 5/20/2021 the last updated release for the app-release date could be 4/20/2021&lt;/P&gt;&lt;P&gt;Now creating a pie chart comparing today's date, it will show that the app-release-date is out of date by 30 days but that is not the case, it just means that the most recent date for app-release-date is dated 4/20/2021.&lt;/P&gt;&lt;P&gt;The question is how will I use the 4/20/2021 in an "eval=case" condition and using the 4/20/2021 as the most recent date instead of "now()" conditions&lt;/P&gt;&lt;P&gt;For your perspective this is what I've done if using the "now()" conditions as a variable:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;| eval av-release-date=round(strptime('av-release-date', "%Y-%m-%d %H:%M:%S")), today=now(), timediff=today-'av-release-date', chart_date=strftime('av-release-date', "%Y-%m-%d")&lt;BR /&gt;| eval color=case(timediff&amp;lt;=86400, "within 24 hrs", timediff&amp;gt;86400 AND timediff&amp;lt;=259200, "within 72 hrs", timediff&amp;gt;259200 AND timediff&amp;lt;=604800, "within 168 hrs", timediff&amp;gt;604800, "over 168 hrs")&lt;BR /&gt;| stats count by color&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;this returns a chart that look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RonD_0-1621519563448.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14234i2D60A242E22AFB11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RonD_0-1621519563448.png" alt="RonD_0-1621519563448.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The app-release-date conditions will be:&lt;/P&gt;&lt;P&gt;The most recent = Green -----&amp;gt; the most recent is not "now()" but it could be 4/20/2021&lt;/P&gt;&lt;P&gt;Most recent – 7 days = yellow&lt;/P&gt;&lt;P&gt;Most recent – 30 days = red&lt;/P&gt;&lt;P&gt;Most recent &amp;nbsp;&amp;gt; 30 days = black&lt;/P&gt;&lt;P&gt;Please advise, and thank you in advance.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 14:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-date-comparison/m-p/552397#M156787</guid>
      <dc:creator>RonD</dc:creator>
      <dc:date>2021-05-20T14:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-date-comparison/m-p/552406#M156791</link>
      <description>&lt;P&gt;What are you trying to measure, the difference between app-release-date and av-release-date or app-release-date and today or something else?&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 14:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-date-comparison/m-p/552406#M156791</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-20T14:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date comparison</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-date-comparison/m-p/552438#M156799</link>
      <description>&lt;P&gt;Not the difference, but using the app-release-date (past date) using this as the most recent date and use that as the starting point for this condition&lt;/P&gt;&lt;P&gt;[substitute the most recent as app-release-date]&lt;/P&gt;&lt;P&gt;The most recent = Green&lt;/P&gt;&lt;P&gt;Most recent – 7 days = yellow&lt;/P&gt;&lt;P&gt;Most recent – 30 days = red&lt;/P&gt;&lt;P&gt;Most recent &amp;nbsp;&amp;gt; 30 days = black&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 18:12:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-date-comparison/m-p/552438#M156799</guid>
      <dc:creator>RonD</dc:creator>
      <dc:date>2021-05-20T18:12:20Z</dc:date>
    </item>
  </channel>
</rss>

