<?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 Alert if data not received to an index for 1 hour in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349812#M5565</link>
    <description>&lt;P&gt;I am currently using this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit OR index=_internal OR index=_introspection OR index=a OR index=b OR index=c OR index=d earliest=-1h latest=-59m | stats count by index | where count=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried input lookups for listing all the indexes but didn't get far quickly. If I take off the where command, it will show a count of events for only the indexes that have events. So when I say where=0 there are not indexes to be seen.&lt;/P&gt;

&lt;P&gt;How can I make it search those indexes and tell me if they have in fact had no events?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 22:51:27 GMT</pubDate>
    <dc:creator>denose</dc:creator>
    <dc:date>2018-03-14T22:51:27Z</dc:date>
    <item>
      <title>Alert if data not received to an index for 1 hour</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349812#M5565</link>
      <description>&lt;P&gt;I am currently using this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit OR index=_internal OR index=_introspection OR index=a OR index=b OR index=c OR index=d earliest=-1h latest=-59m | stats count by index | where count=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried input lookups for listing all the indexes but didn't get far quickly. If I take off the where command, it will show a count of events for only the indexes that have events. So when I say where=0 there are not indexes to be seen.&lt;/P&gt;

&lt;P&gt;How can I make it search those indexes and tell me if they have in fact had no events?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 22:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349812#M5565</guid>
      <dc:creator>denose</dc:creator>
      <dc:date>2018-03-14T22:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if data not received to an index for 1 hour</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349813#M5566</link>
      <description>&lt;P&gt;This wont work since your looking for a count equal to zero rather than null values. You may also want to change your time fields since your alerts wlll arrive an hour late&lt;/P&gt;

&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval count="" 
| append [ | search index=_audit OR index=_internal OR index=_introspection OR index=a OR index=b OR index=c OR index=d earliest=-1h latest=-59m | stats count by index | fillnull value=0 | where count=0]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 23:56:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349813#M5566</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-03-14T23:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if data not received to an index for 1 hour</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349814#M5567</link>
      <description>&lt;P&gt;Thanks, I still don't get any indexes listed with 0 events.&lt;BR /&gt;
It just returns, under the Statistics tab, the current timestamp in the _time column and blank under count column?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 02:41:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349814#M5567</guid>
      <dc:creator>denose</dc:creator>
      <dc:date>2018-03-15T02:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if data not received to an index for 1 hour</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349815#M5568</link>
      <description>&lt;P&gt;You can use following query to check if you're receiving data from a particular source OR not.&lt;/P&gt;

&lt;P&gt;As your threshold time period for not reporting is 1 hour/3600 secs. Run below search for a period longer than 1 hr and set up an alert when there are records returned&lt;/P&gt;

&lt;P&gt;Using metadata command&lt;BR /&gt;
If you want to know based on host&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts index=yourindexNameHere | where host=yourHostNameHere| eval age=(recentTime-now()) | where age&amp;gt;3600 | table host recentTime age | convert ctime(recentTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For sourcetype, use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sourcetypes index=yourindexNameHere | where sourcetype=yourSourcetypeNameHere| eval age=(recentTime-now()) | where age&amp;gt;3600 | table sourcetype recentTime age | convert ctime(recentTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For source, use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sources index=yourindexNameHere | where source=yourSourceNameHere| eval age=(recentTime-now()) | where age&amp;gt;3600 | table source recentTime age | convert ctime(recentTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using tstats&lt;BR /&gt;
Just replace sourcetype with any other metadata field that you want to use.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats max(_time) as recentTime WHERE index=yourindexNameHere  by sourcetype | where sourcetype=yourSourcetypeNameHere| eval age=(recentTime-now()) | where age&amp;gt;3600 | table sourcetype recentTime age | convert ctime(recentTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 07:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349815#M5568</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-03-15T07:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if data not received to an index for 1 hour</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349816#M5569</link>
      <description>&lt;P&gt;Thanks mayurr98 though, I'm not sure how this works on a per index basis?&lt;BR /&gt;
I want to know which index hasn't received events rather than source, sourcetype or hosts.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 22:32:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349816#M5569</guid>
      <dc:creator>denose</dc:creator>
      <dc:date>2018-03-15T22:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if data not received to an index for 1 hour</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349817#M5570</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats max(_time) as recentTime WHERE index=*  by index | eval age=now()-recentTime| where age&amp;gt;3600 | table index recentTime age | convert ctime(recentTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So what I have done is per index I took recent event time and then subtracted it from the current time to calculate age and then applied a condition on age to get the index details. Run this for all time to get accurate results.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 06:58:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349817#M5570</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-03-16T06:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if data not received to an index for 1 hour</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349818#M5571</link>
      <description>&lt;P&gt;Thanks for that. I think that's enough to do what I wanted for now.&lt;/P&gt;

&lt;P&gt;I appreciate your assistance.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 04:28:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Alert-if-data-not-received-to-an-index-for-1-hour/m-p/349818#M5571</guid>
      <dc:creator>denose</dc:creator>
      <dc:date>2018-03-19T04:28:37Z</dc:date>
    </item>
  </channel>
</rss>

