<?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 efficiently check for missing data? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494143#M8367</link>
    <description>&lt;P&gt;Thanks for answering! I don't see how this would solve the problem? To be a more specific, let's say I have the search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=aws sourcetype=cloudtrail   | stats latest(_time) as latest by aws_account_id   | where latest &amp;lt; relative_time(now(), "-1h")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;with the time frame set to "Last 4 hours". And let's say I have the alert set to run once per hour. This will tell me if any &lt;CODE&gt;aws_account_id&lt;/CODE&gt; that was previously sending data has not sent data in the last hour, and it will continue sending that alert once per hour, until the latest event received is more than 4 hours old. Then it will stop alerting, even if the problem of missing data continues. My question is how to make this search continue alerting until the data resumes logging.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2020 06:56:16 GMT</pubDate>
    <dc:creator>joemiller</dc:creator>
    <dc:date>2020-01-30T06:56:16Z</dc:date>
    <item>
      <title>How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494141#M8365</link>
      <description>&lt;P&gt;We have been running alerts that periodically check various sourcetypes and notify us if there are zero events found in order to find out if something has broken with logging or indexing and we are missing data. I'm going to set this up for some AWS logs (e.g. CloudTrail) which we are collecting for multiple (10+) AWS accounts. &lt;/P&gt;

&lt;P&gt;The goal is to be alerted if for example CloudTrail logs are missing for ANY one of the 10+ AWS accounts we're monitoring. I'm aware of two approaches that would work, but each with pros/cons. I wonder if somebody has a suggestion that combines the pros of both of these approaches and avoids the cons.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;I. Use one saved alert to search all of the AWS accounts, e.g.:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;CODE&gt;index=aws sourcetype=cloudtrail&lt;BR /&gt;
| stats latest(_time) as latest by aws_account_id&lt;BR /&gt;
| where latest &amp;lt; relative_time(now(), "-1h")&lt;/CODE&gt;&lt;BR /&gt;
And alert when there ARE results for this.&lt;/P&gt;

&lt;P&gt;Pros: only one search/alert needed, only get one alert message covering all accounts with missing data (if more than one)&lt;BR /&gt;
Cons: only works during the time range of the search (if the problem continues beyond the time range of the search, we'll just stop hearing about it)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;II. Use one saved alert for each AWS account, e.g.&lt;/STRONG&gt;&lt;BR /&gt;
&lt;CODE&gt;index=aws sourcetype=cloudtrail aws_account_id=foo&lt;/CODE&gt; and&lt;BR /&gt;
&lt;CODE&gt;index=aws sourcetype=cloudtrail aws_account_id=bar&lt;/CODE&gt; etc&lt;BR /&gt;
And set up individual alerts for each one and alert when there are NO results.&lt;/P&gt;

&lt;P&gt;Pros: not dependent on the time range of the search, if the problem continues beyond the time range of the search, the alert will keep complaining until the problem is resolved&lt;BR /&gt;
Cons: need to set up a separate alert for each AWS account, including a new one every time we add a new AWS account. If the problem affects multiple accounts, we'll get spammed with separate alerts for each one&lt;/P&gt;

&lt;P&gt;Is there a way to get the pros of both of these methods without the cons?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 18:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494141#M8365</guid>
      <dc:creator>joemiller</dc:creator>
      <dc:date>2020-01-29T18:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494142#M8366</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=aws sourcetype=cloudtrail 
| stats latest(_time) as latest by aws_account_id 
| where latest &amp;lt; relative_time(now(), "-1h") AND latest &amp;gt; relative_time(now(), "-2h") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Continuous omissions are eliminated by using a query.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 02:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494142#M8366</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-30T02:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494143#M8367</link>
      <description>&lt;P&gt;Thanks for answering! I don't see how this would solve the problem? To be a more specific, let's say I have the search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=aws sourcetype=cloudtrail   | stats latest(_time) as latest by aws_account_id   | where latest &amp;lt; relative_time(now(), "-1h")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;with the time frame set to "Last 4 hours". And let's say I have the alert set to run once per hour. This will tell me if any &lt;CODE&gt;aws_account_id&lt;/CODE&gt; that was previously sending data has not sent data in the last hour, and it will continue sending that alert once per hour, until the latest event received is more than 4 hours old. Then it will stop alerting, even if the problem of missing data continues. My question is how to make this search continue alerting until the data resumes logging.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 06:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494143#M8367</guid>
      <dc:creator>joemiller</dc:creator>
      <dc:date>2020-01-30T06:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494144#M8368</link>
      <description>&lt;P&gt;&lt;CODE&gt;with the time frame set to "Last 4 hours".&lt;/CODE&gt;&lt;BR /&gt;
I think the time frame set to par hour. will you change &lt;EM&gt;time frame&lt;/EM&gt;?&lt;BR /&gt;
why time frame is "Last 4 hours"?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494144#M8368</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-30T07:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494145#M8369</link>
      <description>&lt;P&gt;I have the alert running once per hour, and the search time frame as "last 4 hours". This way, the results include any events in the last 4 hours where the timestamp is more than one hour old (specifically, more than one hour old, and less than four hours old). &lt;/P&gt;

&lt;P&gt;If you set the time frame also to one hour, this search would produce no results at all (because there are no events with a timestamp more than one hour old if you're only looking at a time frame of last one hour).&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494145#M8369</guid>
      <dc:creator>joemiller</dc:creator>
      <dc:date>2020-01-30T07:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494146#M8370</link>
      <description>&lt;P&gt;do you make somthing flag?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 11:43:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494146#M8370</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-30T11:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494147#M8371</link>
      <description>&lt;P&gt;Not sure what you mean by that?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 17:53:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494147#M8371</guid>
      <dc:creator>joemiller</dc:creator>
      <dc:date>2020-01-30T17:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494148#M8372</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| eval flag=if(latest &amp;lt; relative_time(now(), "-1h") AND latest &amp;gt; relative_time(now(), "-2h") ,"flag",NULL)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;like above.&lt;BR /&gt;
There is the event has flag . then fire alert.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=aws sourcetype=cloudtrail 
 | stats latest(_time) as latest by aws_account_id
 | eval flag=if(latest &amp;lt; relative_time(now(), "-1h") AND latest &amp;gt; relative_time(now(), "-2h") ,"flag",NULL)
 | where isnotnull(flag)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;like this.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 20:12:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494148#M8372</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-30T20:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494149#M8373</link>
      <description>&lt;P&gt;If I do:&lt;BR /&gt;
&lt;CODE&gt;index=aws sourcetype=cloudtrail&lt;/CODE&gt;&lt;BR /&gt;
The results can include events with&lt;BR /&gt;
&lt;CODE&gt;aws_account_id=123&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;aws_account_id=456&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;aws_account_id=789&lt;/CODE&gt;&lt;BR /&gt;
So if &lt;CODE&gt;aws_account_id=789&lt;/CODE&gt; stops sending logs to splunk, now those events are missing.  So if I do search: &lt;CODE&gt;index=aws sourcetype=cloudtrail aws_account_id=789&lt;/CODE&gt; I can alert when there are zero matches, and this works good, it will continue to send alerts until the missing data problem is fixed. The problem is I would need to do this for every aws_account_id value.&lt;/P&gt;

&lt;P&gt;If I do your suggestion, the alerts will stop after the latest event from the missing aws_account_id value is outside the time range of the search. But I don't want the alerts to stop until the problem is fixed.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:58:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494149#M8373</guid>
      <dc:creator>joemiller</dc:creator>
      <dc:date>2020-09-30T03:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to efficiently check for missing data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494150#M8374</link>
      <description>&lt;P&gt;I see, as  you like.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;We have been running alerts that periodically check various sourcetypes and notify us if there are zero events found in order to find out if something has broken with logging or indexing and we are missing data&lt;BR /&gt;
my query works for this, I think.&lt;BR /&gt;
If you don't like this, please choose the other.&lt;BR /&gt;
At the point, a missing and the continuing are different,I think.&lt;BR /&gt;
another query and another alert, we need.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 08:55:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-efficiently-check-for-missing-data/m-p/494150#M8374</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-31T08:55:26Z</dc:date>
    </item>
  </channel>
</rss>

