<?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: Splunk alert for missing logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288664#M165780</link>
    <description>&lt;P&gt;The &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Metadata"&gt;metadata command&lt;/A&gt; will do some of what you expect it can tell you when a sourcetype last sent data, but it's not broken down per host.&lt;BR /&gt;
I'd recommend &lt;A href="https://splunkbase.splunk.com/app/2949/"&gt;metawoot&lt;/A&gt; as the metadata command isn't as flexible in terms of the data it provides.&lt;/P&gt;

&lt;P&gt;An alternative example for tstats would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats max(_indextime) AS mostRecent where sourcetype=sourcetype1 OR sourcetype=sourcetype2 groupby sourcetype
| where mostRecent &amp;lt; now()-600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example, that would find anything that is not sent in the last 10 minutes, the search can run over the last 20 minutes and it should still be very quick, to make it faster you can add an index=... into the where clause.&lt;/P&gt;

&lt;P&gt;I would schedule something that looks back 20 minutes every 10 minutes or similar, or adjust the timing as it's appropriate for your environment.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2017 21:24:01 GMT</pubDate>
    <dc:creator>gjanders</dc:creator>
    <dc:date>2017-10-06T21:24:01Z</dc:date>
    <item>
      <title>Splunk alert for missing logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288661#M165777</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Below is a snippet of log pattern generating tons of record. Intending to write a alert if any log are missing for given time time range.&lt;BR /&gt;
sourcetype  source      activity&lt;BR /&gt;
sourcetype1 myLog.log   activity1&lt;BR /&gt;
sourcetype1 myLog.log   activity2&lt;BR /&gt;
sourcetype2 myLog.log   activity3&lt;BR /&gt;
sourcetype2 myLog.log   activity3&lt;BR /&gt;
sourcetype3 myLog.log   activity1&lt;BR /&gt;
sourcetype3 myLog.log   activity2&lt;BR /&gt;
sourcetype3 myLog.log   activity3&lt;/P&gt;

&lt;P&gt;Is a search, lookup or simple individual query on sourcetype best approach for making sure logs are generated for each sourcetype? Looking for best approach. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 20:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288661#M165777</guid>
      <dc:creator>chetan1974</dc:creator>
      <dc:date>2017-10-05T20:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk alert for missing logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288662#M165778</link>
      <description>&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/2949/"&gt;MetaWoot from Splunkbase&lt;/A&gt; would be a nice solution here, alternatively you can use tstats for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where sourcetype=sourcetype1 OR sourcetype=sourcetype2 groupby sourcetype, _time span=10m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then you could find blocks of 10 minutes where the logs are not there or similar&lt;/P&gt;

&lt;P&gt;Or perhaps as per my new update something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats max(_indextime) AS mostRecent where sourcetype=sourcetype1 OR sourcetype=sourcetype2 groupby sourcetype
| where mostRecent &amp;lt; now()-600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above would need to be run over 20 minutes or similar (every 10 minutes) and it advises if a log has not sent any data in for 10 minutes. This may be too sensitive and you will need to adjust it for your environment.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 02:16:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288662#M165778</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2017-10-06T02:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk alert for missing logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288663#M165779</link>
      <description>&lt;P&gt;okay. However, need to get sourcetype names with zero counts. With the query, results includes only sourcetypes with count greater than 0. My intent is to report sourcetypes with missing logs.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 19:13:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288663#M165779</guid>
      <dc:creator>chetan1974</dc:creator>
      <dc:date>2017-10-06T19:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk alert for missing logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288664#M165780</link>
      <description>&lt;P&gt;The &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Metadata"&gt;metadata command&lt;/A&gt; will do some of what you expect it can tell you when a sourcetype last sent data, but it's not broken down per host.&lt;BR /&gt;
I'd recommend &lt;A href="https://splunkbase.splunk.com/app/2949/"&gt;metawoot&lt;/A&gt; as the metadata command isn't as flexible in terms of the data it provides.&lt;/P&gt;

&lt;P&gt;An alternative example for tstats would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats max(_indextime) AS mostRecent where sourcetype=sourcetype1 OR sourcetype=sourcetype2 groupby sourcetype
| where mostRecent &amp;lt; now()-600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example, that would find anything that is not sent in the last 10 minutes, the search can run over the last 20 minutes and it should still be very quick, to make it faster you can add an index=... into the where clause.&lt;/P&gt;

&lt;P&gt;I would schedule something that looks back 20 minutes every 10 minutes or similar, or adjust the timing as it's appropriate for your environment.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 21:24:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-for-missing-logs/m-p/288664#M165780</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2017-10-06T21:24:01Z</dc:date>
    </item>
  </channel>
</rss>

