<?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 trigger alerts when _indextime != _time? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390979#M6864</link>
    <description>&lt;P&gt;I'm not sure you want the ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-2h@h latest=+2h@h
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as this ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_index_earliest=-17m@m _index_latest=-2m@m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is what you are really after. You want to alert on the stuff as is comes in (being indexed) not based at all on the actual time of the event. What if the machine was off for four hours and is turned back on? The _time (earliest) will be -4h and fall outside your search as it doesn't meet the first part even though it meets the second part. I think you really just want ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=x sourcetype=y _index_earliest=-17m@m _index_latest=-2m@m
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 29 Dec 2018 00:22:41 GMT</pubDate>
    <dc:creator>dstuder</dc:creator>
    <dc:date>2018-12-29T00:22:41Z</dc:date>
    <item>
      <title>How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390958#M6843</link>
      <description>&lt;P&gt;Problem definition: there are 3 possible "times" associated with an event and this can cause events to be missed in scheduled searches&lt;/P&gt;

&lt;P&gt;Example: _time may have value 1 OR 2 but not 3 (_indextime)&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;the timestamp listed in the _raw event data (TIME_PREFIX or other config) = 0:4:58&lt;/LI&gt;
&lt;LI&gt;the time the event is seen up by the forwarder (CURRENT) = 0:5:58&lt;/LI&gt;
&lt;LI&gt;the time the event is written to disk (_indextime) = 0:6:03 &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;if either time 1 or time 2 is not equal to _indextime your event can be missed by a search&lt;/P&gt;

&lt;P&gt;for example if you have an event where CURRENT time is 0:5:58 seconds, timestamp from _raw is 0:4:58, and _indextime is 0:6:03 then a search running every minute &lt;CODE&gt;-1m@m to @m&lt;/CODE&gt; will never see this particular event&lt;/P&gt;

&lt;P&gt;for sourcetypes with various props configurations such as EXTRACT, EVAL, FIELDALIAS, LOOKUP, etc &lt;STRONG&gt;there can easily be differences of several seconds between _time and _index time meaning an event is not available on disk until after the time the scheduled search has run&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390958#M6843</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2020-09-29T20:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390959#M6844</link>
      <description>&lt;P&gt;Solution:&lt;/P&gt;

&lt;P&gt;if the data set permits set _time to the following in props.conf: DATETIME_CONFIG = CURRENT&lt;/P&gt;

&lt;P&gt;re-write -1m@m to @m searches to accommodate potential delays: -2m@m to -1m@m&lt;/P&gt;

&lt;P&gt;you can be creative with searches that hourly or daily for example -61m@m to -1m@m&lt;/P&gt;

&lt;P&gt;don't forget to adjust your cron schedule accordingly if necessary&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390959#M6844</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2020-09-29T20:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390960#M6845</link>
      <description>&lt;P&gt;There is a delay before an indexed event is searchable (Transmission from Forwarders, event processing at indexer, indexing process and creating a searchable copy of the data), so it's often recommended to allow some delay, say 1-3 mins, when creating alert. E.g. if you want to run your search every minute, looking at one minute time period, your time-range can be -2m@m to -1m@m (allowing 1 min to indexing to be complete) OR -3m@m to -2m@m (allowing 2 min to indexing to be complete). This is because the time range of your search (earliest/latest) is applied on &lt;EM&gt;time not _indextime value, thus the event has to be searchable before a search can fetch it.&lt;BR /&gt;
Alternately, you can use indextime time modifier in your search. (read 3rd para)&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/SearchTimeModifiers#_time_and" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/SearchTimeModifiers#_time_and&lt;/A&gt;&lt;/EM&gt;_indextime_fields&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:42:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390960#M6845</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T20:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390961#M6846</link>
      <description>&lt;P&gt;what is the question?&lt;BR /&gt;
many times users leverage the _indextime field  and something like &lt;CODE&gt;_index_earliest=-6m@m _index_latest=-1m@m&lt;/CODE&gt; for alerts / saved searches purposes &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390961#M6846</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-09-29T20:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390962#M6847</link>
      <description>&lt;P&gt;hello there, &lt;BR /&gt;
i will not advise on that method,&lt;BR /&gt;
example: delay or bringing data from the past will apply index time as time&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 19:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390962#M6847</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-08-01T19:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390963#M6848</link>
      <description>&lt;P&gt;@marycordovacaa - We've unaccepted your answer.  The first item in your answer -- which because of the way it is written, most people will read as if it were the primary solution -- is not advisable.  (This is one of the few cases in which splunk answers allows down-votes:  when the answer is ill-advised and likely to be harmful to the user's system.)  If you'd like to reorder your information, perhaps putting the first item last and using a break between, and clarify that the first item is rarely applicable, then your solution would be more correct.  &lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390963#M6848</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-02T16:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390964#M6849</link>
      <description>&lt;P&gt;You are correct that &lt;CODE&gt;_time&lt;/CODE&gt; will, in practice, never match &lt;CODE&gt;_indextime&lt;/CODE&gt;.  They should not, because those two items have nothing to do with one another.  They will only match when an event has NO specified time in its structure and is in essence merely recording internal information as/of the instant it is recorded.&lt;/P&gt;

&lt;P&gt;You are correct that there is a processing delay between &lt;CODE&gt;_time&lt;/CODE&gt; and &lt;CODE&gt;_indextime&lt;/CODE&gt; in  almost all cases, and that this delay can be any length of time that the transmission chain takes to move the data from place to place.   In the case of a monthly transaction file transmitted by a vendor, the difference may even be more than 30 days.&lt;/P&gt;

&lt;P&gt;The above are the reason why the first rule of administering Splunk is "Know your data."   If your various computers are phoning home every 5 minutes, then the lag time can be in the range of up to 5m to 7m depending on load.  That means that a summarizing search should run with a delay of perhaps 10m, to accurately summarize that particular kind of data.&lt;/P&gt;

&lt;P&gt;This kind of tuning is part and parcel of Splunk administration.  &lt;/P&gt;

&lt;P&gt;And, yes, the standard for that is to schedule hourly jobs X minutes after the hour, for example, and to use &lt;CODE&gt;earliest=-1h@h latest=@h&lt;/CODE&gt; ... so with the exception of your first suggestion, which is seldom going to be advisable, your answer is generally correct.  &lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390964#M6849</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-02T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390965#M6850</link>
      <description>&lt;P&gt;@DalJeanis &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;this is the solution confirmed as acceptable by Splunk Support&lt;/LI&gt;
&lt;LI&gt;answers should not be unaccepted if an acceptable answer is not provided&lt;/LI&gt;
&lt;LI&gt;no justification for the reason why the answer is not advisable&lt;/LI&gt;
&lt;LI&gt;no justification for the reason why this is likely to be harmful to the system&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:22:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390965#M6850</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2018-08-02T16:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390966#M6851</link>
      <description>&lt;P&gt;&lt;CODE&gt;earliest=-1h@h latest=@h&lt;/CODE&gt; does not resolve the issue because if i have an event where _time is back dated prior to actual indexing and the event is written to disk after my search has run on the hour i will be missing that particular event&lt;/P&gt;

&lt;P&gt;if _time or _indextime were not epoch values with second level granularity and were only stamped with minute level granularity then perhaps that would work, except in the case where events have a minute's worth of delay or more&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=-61m@m latest=-1m@m&lt;/CODE&gt; is the only way to ensure that events are captured by search when you have delays of several seconds and in order to ensure that those events are time stamped within 59 seconds of indexing and therefore available to the search is to set _time to CURRENT&lt;/P&gt;

&lt;P&gt;in my case over the course of a week the vast majority of my events for this particular data set have a 0 second time difference using a regex time EXTRACT however, &lt;EM&gt;delays of up to 99 minutes for some events were discovered and there is no way to craft a search that would account for such a widely variable time delay without both, delaying all notifications for the data set and, introducing an unacceptable deviation from near-real time monitoring&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;this particular data set includes high fidelity security alerts and can confirm that a 6 minuted delay caused a notification to be missed and we were only made aware of having missed this through another 3rd party notification outside of Splunk&lt;/P&gt;

&lt;P&gt;as @DalJeanis stated, knowing your data is pre-requisite, and that was the first qualification made in the original answer submitted&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 17:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390966#M6851</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2018-08-02T17:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390967#M6852</link>
      <description>&lt;P&gt;thanks for that tip, I hadn't thought of it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 17:43:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390967#M6852</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2018-08-02T17:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390968#M6853</link>
      <description>&lt;P&gt;@marycordovacaa - The problem is all the unspoken caveats in the line "if the dataset permits."  We assume that Splunk Support has examined your use case, your particular data set, to give you that advice for that dataset.  This is not a generally correct solution.&lt;/P&gt;

&lt;P&gt;What that key word is telling the system is to &lt;EM&gt;ignore the explicit time recorded on the events&lt;/EM&gt;, and instead use the current &lt;CODE&gt;_indextime&lt;/CODE&gt; as the &lt;CODE&gt;_time&lt;/CODE&gt;.  There are very few data sets for which this would be appropriate and permitted.  &lt;/P&gt;

&lt;P&gt;Consider log files. If you used this setting, correlation searches would become completely untenable if the times of the individual events were constantly being altered randomly by differing delays in the ingestion pipeline.  A later event sent to a faster indexer would get an earlier &lt;CODE&gt;_time&lt;/CODE&gt; value.  Thus, in an era of firewall/DHCP/NAT assignment and reuse of IPs, for example, properly deciding who had an IP at a given time that some other thing occurred would become even harder than it is.&lt;/P&gt;

&lt;P&gt;Using this method to solve the problem of indexing delays is like trying to get moths out of your closet by throwing in a hand grenade. Therefore, that first suggestion is extremely unlikely to be the right answer for most people reading this question and answer.  &lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 17:43:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390968#M6853</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-02T17:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390969#M6854</link>
      <description>&lt;P&gt;@marycordovacaa - If you had asked that question - how do you pick up events where the _time is older than X but have been indexed after X, I would have given you THIS answer -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch 
   [ your search earliest=-4m@m latest=-2m@m
   ] 
   [ your search  earliest=-2h@m latest=-4m@m 
    | where _indextime&amp;gt;relative_time(now(),"-4m@m")
  ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;done.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 18:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390969#M6854</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-02T18:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390970#M6855</link>
      <description>&lt;P&gt;thanks, that is helpful but i would just highlight the caveat below P3:&lt;/P&gt;

&lt;P&gt;Note: When using index-time based modifiers such as index_earliest and index_latest, your search must also have an event-time window which will retrieve the events. In other words, chunks of events might be ruled out based on the non index-time window as well as the index-time window. To be certain of retrieving every event based on index-time, you must run your search using All Time.&lt;/P&gt;

&lt;P&gt;as we know...All Time is dangerous (and generally not the use case searches are based on)!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390970#M6855</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2020-09-29T20:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390971#M6856</link>
      <description>&lt;P&gt;thanks, that's more helpful for small data sets like this, so i guess there is way if one gets more creative &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;for anyone else, tips inside that search query:&lt;/P&gt;

&lt;P&gt;combining time designations like hours and minutes &lt;CODE&gt;-2h@m&lt;/CODE&gt;&lt;BR /&gt;
usecase for multisearch&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 19:16:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390971#M6856</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2018-08-02T19:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390972#M6857</link>
      <description>&lt;P&gt;This is a helpful point in making a decision to use CURRENT time &lt;EM&gt;or not&lt;/EM&gt;:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Consider log files. If you used this setting, correlation searches would become completely untenable if the times of the individual events were constantly being altered randomly by differing delays in the ingestion pipeline. A later event sent to a faster indexer would get an earlier _time value. Thus, in an era of firewall/DHCP/NAT assignment and reuse of IPs, for example, properly deciding who had an IP at a given time that some other thing occurred would become even harder than it is.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 02 Aug 2018 19:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390972#M6857</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2018-08-02T19:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390973#M6858</link>
      <description>&lt;P&gt;&lt;STRONG&gt;the threads started to get convoluted so here is a summary for anyone else with this issue:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;problem: event &lt;CODE&gt;_time&lt;/CODE&gt; &amp;lt; cron schedule &amp;lt; event available on disk to be searched resulting in events being missed in alerts&lt;/STRONG&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;OL&gt;
&lt;LI&gt;preserves near real-time monitoring&lt;/LI&gt;
&lt;LI&gt;preserves actual event timestamping in _time&lt;/LI&gt;
&lt;LI&gt;accounts for variable time delays such as between 0-99 minutes&lt;/LI&gt;
&lt;LI&gt;may not be good for extremely high volume indexes or extremely wide time frames but is likely the best general practice&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;credit @DalJeanis &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| multisearch &lt;BR /&gt;
    [ your search earliest=-4m@m latest=-2m@m&lt;BR /&gt;
    ] &lt;BR /&gt;
    [ your search  earliest=-2h@m latest=-4m@m &lt;BR /&gt;
     | where _indextime&amp;gt;relative_time(now(),"-4m@m")&lt;BR /&gt;
   ]&lt;/CODE&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;(does this need a rename or eval of &lt;CODE&gt;_indextime&lt;/CODE&gt; somewhere?)&lt;/LI&gt;
&lt;LI&gt;good example of &lt;CODE&gt;multisearch&lt;/CODE&gt; usage&lt;/LI&gt;
&lt;LI&gt;good example of combined various time notations &lt;CODE&gt;-2h@m&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;hard to test retroactively against data that will always match the 1st search regardless of the 2nd search unless the data can be artificially sent/received, the search run, the timestamp back dated, and then the data indexed all within the questionable time range of a few seconds or minutes - &lt;EM&gt;I need to figure out a way to stimulus response validate this&lt;/EM&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;HR /&gt;

&lt;P&gt;credit: @somesoni2 (read 3rd para): &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/SearchTimeModifiers#_time_and__indextime_fields"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/SearchTimeModifiers#_time_and__indextime_fields&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;(NOTE caveat below 3rd para however)&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;credit @adonio: many times users leverage the &lt;CODE&gt;_indextime&lt;/CODE&gt; field and something like &lt;CODE&gt;_index_earliest=-6m@m _index_latest=-1m@m&lt;/CODE&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;last ditch solution &lt;STRONG&gt;&lt;EM&gt;if the data set permits&lt;/EM&gt;&lt;/STRONG&gt; :&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;set &lt;CODE&gt;_time&lt;/CODE&gt; to the following in props.conf: &lt;CODE&gt;DATETIME_CONFIG = CURRENT&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;re-write -1m@m to @m searches to accommodate potential delays: -2m@m to -1m@m&lt;/LI&gt;
&lt;/OL&gt;

&lt;HR /&gt;</description>
      <pubDate>Thu, 02 Aug 2018 20:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390973#M6858</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2018-08-02T20:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390974#M6859</link>
      <description>&lt;P&gt;Thanks, @marycordovacaa - SPL and regexes are my specialties within the Trust.  You'll also often find great tips like this from @somesoni2 and @woodcock, and useful straightforward answers by @adonio, @martin_mueller, @MuS and @jkat54 on more general subjects.  If it's dashboarding, then you want to watch for answers by @niketnilay, who is our guru for that kind of thing.  &lt;/P&gt;

&lt;P&gt;With regard to &lt;CODE&gt;multisearch&lt;/CODE&gt;, I used that only because of the where clause that is applicable for only half the search. Looking at it again, since the &lt;CODE&gt;_indextime&lt;/CODE&gt; test will always be true for any events that meet the first search criteria, you can actually drop the &lt;CODE&gt;multisearch&lt;/CODE&gt; and code it with &lt;CODE&gt;OR&lt;/CODE&gt; and parenthesis and it will work just as well, like this... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( your search earliest=-4m@m latest=-2m@m) 
OR
( your search  earliest=-2h@m latest=-4m@m) 
| where _indextime&amp;gt;relative_time(now(),"-4m@m")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...and that, of course, resolves down to... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( your search  earliest=-2h@m latest=-2m@m) 
| where _indextime&amp;gt;relative_time(now(),"-4m@m")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...which, just in case something in this group of things being indexed is being assigned a "future-ish" &lt;CODE&gt;_time&lt;/CODE&gt;, might be safest as...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( your search  earliest=-2h@m latest=-2m@m) 
| where _indextime&amp;gt;=relative_time(now(),"-4m@m") AND
       _indextime&amp;lt;relative_time(now(),"-2m@m") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or, you can leave it as the &lt;CODE&gt;multisearch&lt;/CODE&gt;, since the intention behind that is much more clear to a casual observer. &lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 01:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390974#M6859</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-03T01:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390975#M6860</link>
      <description>&lt;P&gt;Very good writeup.&lt;/P&gt;

&lt;P&gt;For a confidence test, you can do a one-shot ingestion of any available past-dated CSV into a test index.  &lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 01:22:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390975#M6860</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-03T01:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390976#M6861</link>
      <description>&lt;P&gt;Say you run a search every minute, over one minute of some notion of time. You want to see every event exactly once - not twice, not zero times. You can't do &lt;CODE&gt;-2m@m to -m@m&lt;/CODE&gt; because events delayed by more than one minute might be missed. If your maximum indexing delay you want to cover were one day, you could do &lt;CODE&gt;-d-m@m to -d@m&lt;/CODE&gt;, that would see every event exactly once... but would introduce an alert delay of one day, for all events. Not good.&lt;/P&gt;

&lt;P&gt;Here's what I often do to accommodate unknown/large/varying indexing delays:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;schedule the search to run every minute&lt;/LI&gt;
&lt;LI&gt;set the timerange to &lt;CODE&gt;-d to +d&lt;/CODE&gt; to allow for that one day maximum skew between indexing time and time&lt;/LI&gt;
&lt;LI&gt;add &lt;CODE&gt;_index_earliest=-2m@m _index_latest=-m@m&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;That way you look at every event exactly once, ensured by the &lt;CODE&gt;_index_earliest/_latest&lt;/CODE&gt; and allow for the full day of skew, ensured by the regular timerange.&lt;BR /&gt;
During a global indexing delay, e.g. no network to your indexers, the search will find nothing. Once indexing runs again it will find lots of things, everything that came in during that minute regardless of event timestamp.&lt;/P&gt;

&lt;P&gt;That's for alerting. To detect indexing delays [or timezone configuration issues] I like this approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats max(_indextime) as max where index=foo by host _time span=1s
| eval delta = max - _time | timechart max(delta) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/232475/how-to-search-when-an-event-was-indexed.html#comment-236221"&gt;https://answers.splunk.com/answers/232475/how-to-search-when-an-event-was-indexed.html#comment-236221&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 11:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390976#M6861</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-08-03T11:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger alerts when _indextime != _time?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390977#M6862</link>
      <description>&lt;P&gt;@marycordovacaa - Looks like you're pulling in help from the heavy hitters with this one.  Martin's write up is pretty clearly equivalent to what we discussed last night.  The final note about using &lt;CODE&gt;tstats&lt;/CODE&gt; to detect and analyze delays is a great trick.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 12:35:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-trigger-alerts-when-indextime-time/m-p/390977#M6862</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-03T12:35:08Z</dc:date>
    </item>
  </channel>
</rss>

