<?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: How to generate a search that finds events that are older than 90 days? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-finds-events-that-are-older-than/m-p/365785#M107876</link>
    <description>&lt;P&gt;try something like this. you only need the rex if you don't already have the raw events broken out.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....|rex field=_raw "FirstOccurrence(?&amp;lt;FirstOccurrence&amp;gt;.*)!"LastOccurrence"
|eval FirstOccurrence=strptime(FirstOccurrence,"%m/%d/%Y %H:%M:%S %p")
|eval lastNinetyDays=now()-7776000
|where FirstOccurrence&amp;lt;=lastNinetyDays
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Mar 2017 12:08:37 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-03-17T12:08:37Z</dc:date>
    <item>
      <title>How to generate a search that finds events that are older than 90 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-finds-events-that-are-older-than/m-p/365784#M107875</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Below is my sample event. I want to create a search base which would return all such below events where FirstOccurrence field is more than 90 days old. This is a date field showing the time stamp when the event triggered first. I want to look for such events which are older than 90 days.  Can you please help me with this? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;UPDATE:: "Dash-Time"=03/17/2017 09:52:02 AM!"Node"="TOKAR"!"NodeAlias"="TOK1-RR1"!"Severity"=3!"FirstOccurrence"=12/20/2016 03:36:41 PM!"LastOccurrence"=03/17/2017 09:52:02 AM!"Summary"="BGP Peer Connection Idle  ( bgpPeerRemoteAddr: 10.108.73.16 )"!"Count"=117648!"Category"="WAN,WAN-CORE"!"MonitoringAgent"="MttrapdProbe@c702quanmpnci"!"AlertGroup"="BGP Peer Status"!"AlertKey"="bgpPeerEntry.10.108.73.16"!"Maintenance"=0!"Identifier"="TOKAR bgpPeerEntry.10.108.73.16 BGP Peer Status 1 IETF-BGP MttrapdProbe@c702quanmpnci 2 1"!"Serial"=14261338!"Action"="" ::UPDATE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Mar 2017 10:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-finds-events-that-are-older-than/m-p/365784#M107875</guid>
      <dc:creator>srikanthpanchak</dc:creator>
      <dc:date>2017-03-17T10:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search that finds events that are older than 90 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-finds-events-that-are-older-than/m-p/365785#M107876</link>
      <description>&lt;P&gt;try something like this. you only need the rex if you don't already have the raw events broken out.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....|rex field=_raw "FirstOccurrence(?&amp;lt;FirstOccurrence&amp;gt;.*)!"LastOccurrence"
|eval FirstOccurrence=strptime(FirstOccurrence,"%m/%d/%Y %H:%M:%S %p")
|eval lastNinetyDays=now()-7776000
|where FirstOccurrence&amp;lt;=lastNinetyDays
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Mar 2017 12:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-finds-events-that-are-older-than/m-p/365785#M107876</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-03-17T12:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search that finds events that are older than 90 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-finds-events-that-are-older-than/m-p/365786#M107877</link>
      <description>&lt;P&gt;In the rex, you need to escape the quote before &lt;CODE&gt;"LastOccurrence"&lt;/CODE&gt;, but actually I'd just delete everything after the &lt;CODE&gt;!&lt;/CODE&gt; since the &lt;CODE&gt;!&lt;/CODE&gt; is the delimiter.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 19:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-that-finds-events-that-are-older-than/m-p/365786#M107877</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-17T19:06:23Z</dc:date>
    </item>
  </channel>
</rss>

