<?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: What is the best and most efficient way to write alert for index with no events? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474628#M9381</link>
    <description>&lt;P&gt;This has been solved many times including:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Meta Woot!: &lt;A href="https://splunkbase.splunk.com/app/2949/" target="test_blank"&gt;https://splunkbase.splunk.com/app/2949/&lt;/A&gt;
TrackMe: &lt;A href="https://splunkbase.splunk.com/app/4621/" target="test_blank"&gt;https://splunkbase.splunk.com/app/4621/&lt;/A&gt;,
Broken Hosts App for Splunk: &lt;A href="https://splunkbase.splunk.com/app/3247/" target="test_blank"&gt;https://splunkbase.splunk.com/app/3247/&lt;/A&gt;
Alerts for Splunk Admins ("ForwarderLevel" alerts): &lt;A href="https://splunkbase.splunk.com/app/3796/" target="test_blank"&gt;https://splunkbase.splunk.com/app/3796/&lt;/A&gt;
Splunk Security Essentials(https://docs.splunksecurityessentials.com/features/sse_data_availability/): &lt;A href="https://splunkbase.splunk.com/app/3435/" target="test_blank"&gt;https://splunkbase.splunk.com/app/3435/&lt;/A&gt;
Monitoring Console: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/DMC/Configureforwardermonitoring" target="test_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/DMC/Configureforwardermonitoring&lt;/A&gt;
Deployment Server: &lt;A href="https://docs.splunk.com/Documentation/DepMon/latest/DeployDepMon/Troubleshootyourdeployment#Forwarder_warnings" target="test_blank"&gt;https://docs.splunk.com/Documentation/DepMon/latest/DeployDepMon/Troubleshootyourdeployment#Forwarder_warnings&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 23 Feb 2020 20:20:33 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2020-02-23T20:20:33Z</dc:date>
    <item>
      <title>What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474623#M9376</link>
      <description>&lt;P&gt;What is the best and most efficient way to write alert for index with no events? &lt;/P&gt;

&lt;P&gt;I have the following &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest=60m | where count=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sources index=* | eval flatline=round((now()-recentTime)/60,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 07:11:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474623#M9376</guid>
      <dc:creator>dannyze</dc:creator>
      <dc:date>2020-02-20T07:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474624#M9377</link>
      <description>&lt;P&gt;To find indexes with no events use both eventcount and tstats.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventcount summarize=false index=* | fields index | dedup index | join type=left [ | tstats count as event_count WHERE (index=* earliest=-60m) by index] | fillnull value=0 | where event_count=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2020 07:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474624#M9377</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-02-20T07:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474625#M9378</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=* earliest=-60m by index 
| append [| eventcount summarize=f index=* |fields index]
| fillnull count
| where count=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To fire alert: event count &amp;gt; 0&lt;BR /&gt;
hi, @manjunathmeti&lt;BR /&gt;&lt;BR /&gt;
I modify your query.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 09:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474625#M9378</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-20T09:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474626#M9379</link>
      <description>&lt;P&gt;@dannyze if you want a different approach with REST API you can try the following however commands like &lt;CODE&gt;tstats, metadata, eventcount and dbinspect&lt;/CODE&gt; are specifically useful while trying to query index related stuff. Since the following approach uses REST API you can output results similar to how you see it in &lt;CODE&gt;Settings&amp;gt; Data &amp;gt; Indexes&lt;/CODE&gt; view (bring in or filter based on other fields like app name, access etc.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /servicesNS/-/-/data/indexes 
| fields title maxTime
| rename title as index
| eval _time=strptime(maxTime,"%Y-%m-%dT%H:%M:%S+%z"), "Last event indexed age"=now()-_time 
| where 'Last event indexed age'&amp;gt;=3600 OR isnull('Last event indexed age')
| eval "Last event indexed age"=if(isnull('Last event indexed age'),"No Data",
                                   replace(replace(tostring('Last event indexed age',"duration"),"\+"," days "),"(\d+)\:(\d+)\:(\d+)\.\d+","\1 hr \2 min \3 sec"))
| fields - maxTime _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2020 10:50:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474626#M9379</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-02-20T10:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474627#M9380</link>
      <description>&lt;P&gt;If you would prefer to go down the apps path&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/4621/"&gt;TrackMe&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/2949/"&gt;Meta Woot!&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/3247/"&gt;Broken Hosts App for Splunk&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Or see previous answers for missing indexes/sourcetypes such &lt;A href="https://answers.splunk.com/answers/214938/how-to-monitor-missing-sourcetypeshosts.html"&gt;as this one&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 09:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474627#M9380</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2020-02-23T09:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474628#M9381</link>
      <description>&lt;P&gt;This has been solved many times including:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Meta Woot!: &lt;A href="https://splunkbase.splunk.com/app/2949/" target="test_blank"&gt;https://splunkbase.splunk.com/app/2949/&lt;/A&gt;
TrackMe: &lt;A href="https://splunkbase.splunk.com/app/4621/" target="test_blank"&gt;https://splunkbase.splunk.com/app/4621/&lt;/A&gt;,
Broken Hosts App for Splunk: &lt;A href="https://splunkbase.splunk.com/app/3247/" target="test_blank"&gt;https://splunkbase.splunk.com/app/3247/&lt;/A&gt;
Alerts for Splunk Admins ("ForwarderLevel" alerts): &lt;A href="https://splunkbase.splunk.com/app/3796/" target="test_blank"&gt;https://splunkbase.splunk.com/app/3796/&lt;/A&gt;
Splunk Security Essentials(https://docs.splunksecurityessentials.com/features/sse_data_availability/): &lt;A href="https://splunkbase.splunk.com/app/3435/" target="test_blank"&gt;https://splunkbase.splunk.com/app/3435/&lt;/A&gt;
Monitoring Console: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/DMC/Configureforwardermonitoring" target="test_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/DMC/Configureforwardermonitoring&lt;/A&gt;
Deployment Server: &lt;A href="https://docs.splunk.com/Documentation/DepMon/latest/DeployDepMon/Troubleshootyourdeployment#Forwarder_warnings" target="test_blank"&gt;https://docs.splunk.com/Documentation/DepMon/latest/DeployDepMon/Troubleshootyourdeployment#Forwarder_warnings&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Feb 2020 20:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474628#M9381</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-02-23T20:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474629#M9382</link>
      <description>&lt;P&gt;Thank you, was looking more for a way to do it with built-in capabilities &lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 23:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474629#M9382</guid>
      <dc:creator>dannyze</dc:creator>
      <dc:date>2020-02-23T23:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best and most efficient way to write alert for index with no events?</title>
      <link>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474630#M9383</link>
      <description>&lt;P&gt;Most of these are built-in capabilities (searches) with some gift-wrapping around that.  My point is: don't reinvent the wheel: download some of these apps (or in the case of #6 and #7, just turn them on) and tear apart their searches and copy what you need.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 23:06:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/What-is-the-best-and-most-efficient-way-to-write-alert-for-index/m-p/474630#M9383</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-02-23T23:06:51Z</dc:date>
    </item>
  </channel>
</rss>

