<?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: Display events when current date is &amp;gt;= 30 days from expiration date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249881#M74579</link>
    <description>&lt;P&gt;Even if I assume it is in milliseconds, this converts to Thu, 31 Jan 2019 05:00:00 GMT!&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2015 14:34:53 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-12-01T14:34:53Z</dc:date>
    <item>
      <title>Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249874#M74572</link>
      <description>&lt;P&gt;Spent all day trying to figure this out. The events I'm working with contain a field with an expiration date in Unix epoch time. I'm trying to bring up a table of events when current date is &amp;gt;= 30days before the expiration date. Combed through documentation and Splunk Answers no luck. Thanks in advance.&lt;/P&gt;

&lt;P&gt;Example data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;expiration_date=1548910800000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Nov 2015 18:41:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249874#M74572</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-11-24T18:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249875#M74573</link>
      <description>&lt;P&gt;See if this gives you some ideas...&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eval dexpire=1548910800 | eval dback30=relative_time(ed, "-30d@d" ) | eval dnow=now() | table dexpire dback30 dnow | foreach d* [eval &amp;lt;&amp;gt;=strftime(&amp;lt;&amp;gt;, "%c")] | eval older=if(dnow&amp;gt;=dback30, "Y", "N")&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 19:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249875#M74573</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-24T19:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249876#M74574</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval deltaDays = (now() - expiration_date)/86400 | where deltaDays&amp;gt;=30
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Nov 2015 19:41:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249876#M74574</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-24T19:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249877#M74575</link>
      <description>&lt;P&gt;Meant to write '&amp;lt;' instead of '&amp;gt;'. Its not giving events where now() is &amp;lt;= 30days of expiration_date&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mysearch...&lt;BR /&gt;
|eval now=now()&lt;BR /&gt;
| eval deltaDays = (now() - expiration_date)/86400 &lt;BR /&gt;
| where deltaDays&amp;lt;=30&lt;BR /&gt;
| table loginuid, token_serial, now, expiration_date&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 20:29:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249877#M74575</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-11-24T20:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249878#M74576</link>
      <description>&lt;P&gt;So did this work for you?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 20:58:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249878#M74576</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-24T20:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249879#M74577</link>
      <description>&lt;P&gt;Sorry for late response was out for Thanksgiving. Hope you enjoyed yours! &lt;/P&gt;

&lt;P&gt;I'm trying to test with this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;my search | eval deltaDays = (now() - expiration_date)/86400 | where deltaDays&amp;lt;=30 | eval expiration_date=expiration_date/1000 | eval Expiration_date=strftime(expiration_date,"%m/%d/%Y") | table loginuid, token_serial, Expiration_date&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I expect to see events where the &lt;CODE&gt;Expiration_date&lt;/CODE&gt; field is &amp;lt;= 30 days from &lt;CODE&gt;now()&lt;/CODE&gt; but this is not the case. Am I using the where command correctly?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 13:04:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249879#M74577</guid>
      <dc:creator>jsven7</dc:creator>
      <dc:date>2015-11-30T13:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249880#M74578</link>
      <description>&lt;P&gt;I did not look closely at your sample data and there is a problem there.  It is neither in epoch, nor in any encoding that I can discern.  If you can convert this to epoch, then my solution will work for you.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 14:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249880#M74578</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-12-01T14:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Display events when current date is &gt;= 30 days from expiration date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249881#M74579</link>
      <description>&lt;P&gt;Even if I assume it is in milliseconds, this converts to Thu, 31 Jan 2019 05:00:00 GMT!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 14:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-events-when-current-date-is-gt-30-days-from-expiration/m-p/249881#M74579</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-12-01T14:34:53Z</dc:date>
    </item>
  </channel>
</rss>

