<?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: Finding Metrics That Fell by 10% in an Hour in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26442#M5107</link>
    <description>&lt;P&gt;access_canonical_server_name, hour, count&lt;BR /&gt;
domain.com, 1360555200.000000, 20 &lt;BR /&gt;
anotherdomain.com, 1360555200.000000, 11&lt;/P&gt;

&lt;P&gt;Do you have an idea how to solve my problem I asked on the initial question? Thank.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:17:10 GMT</pubDate>
    <dc:creator>stephan_berger</dc:creator>
    <dc:date>2020-09-28T13:17:10Z</dc:date>
    <item>
      <title>Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26436#M5101</link>
      <description>&lt;P&gt;Hello Splunk Community,&lt;/P&gt;

&lt;P&gt;I have a question regarding this query (excerpt from the great splunk book):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      earliest=-2h@h latest=@h
      | stats count by date_hour,host
      | stats first(count) as previous, last(count) as current by host
      | where current/previous &amp;lt; 0.9
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For now, I have a query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      earliest=-2m latest=now() | 
      stats count(request) by request, access_canonical_server_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which gives me a list of all requests made to a domain. I would like to compare the counted requests in the past to the count of the requests made in the present, to detect a fall of the metrics like in the inital query above.&lt;/P&gt;

&lt;P&gt;Thanks for your support.&lt;/P&gt;

&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2013 18:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26436#M5101</guid>
      <dc:creator>stephan_berger</dc:creator>
      <dc:date>2013-02-09T18:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26437#M5102</link>
      <description>&lt;P&gt;How is your problem different from the book's example?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2013 21:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26437#M5102</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-09T21:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26438#M5103</link>
      <description>&lt;P&gt;[Edited - Thanks Martin! I made a dumb typo! I have fixed the time range in the first line of the search so that &lt;CODE&gt;latest&lt;/CODE&gt; is now the beginning of the latest hour, not the beginning of the hour before that....]&lt;/P&gt;

&lt;P&gt;Despite the fact that the book uses &lt;CODE&gt;date_hour&lt;/CODE&gt;, I would do it this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-2h@h latest=@h request=*
| eval hour = relative_time(_time,"@h")
| stats count by access_canonical_server_name, hour
| stats first(count) as previous, last(count) as current by access_canonical_server_name
| where current/previous &amp;lt; 0.9
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would not use &lt;CODE&gt;date_hour&lt;/CODE&gt; for two reasons: first, it isn't always available. Second, it is a simple hour number (0-23), which means that it won't work well when the hours cross a date boundary. The above calculation for &lt;CODE&gt;hour&lt;/CODE&gt; will solve both of those problems.&lt;/P&gt;

&lt;P&gt;Also, I have set the time range to be full hours: 2 hours ago compared to 1 hour ago. If you set this search to run every hour at :05 past the hour, it will reliably report on the previous hours. However, if you don't use the &lt;CODE&gt;@h&lt;/CODE&gt;, you may find that you are comparing a full hour to a partial hour - which is probably &lt;EM&gt;not&lt;/EM&gt; what you want.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2013 01:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26438#M5103</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-02-10T01:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26439#M5104</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;thanks for your answer and your effort! Unfortunately, the query is not working quite right:&lt;/P&gt;

&lt;P&gt;access_canonical_server_name, current, previous, delta&lt;BR /&gt;
domain.com, 145, 145, 1&lt;BR /&gt;
anotherdomain, 56, 56, 1&lt;BR /&gt;
subdomain.domain.com, 77,77,1&lt;/P&gt;

&lt;P&gt;The search finds the same results for current and previous, resulting in a delta from 1 or 0 respectively. Would you mind to re-check your query again?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
Steven&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26439#M5104</guid>
      <dc:creator>stephan_berger</dc:creator>
      <dc:date>2020-09-28T13:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26440#M5105</link>
      <description>&lt;P&gt;What do you get when you run just this part of the search?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=-2h@h latest=-1h@h request=*&lt;BR /&gt;
| eval hour = relative_time(_time,"@h")&lt;BR /&gt;
| stats count by access_canonical_server_name, hour&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2013 20:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26440#M5105</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-02-10T20:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26441#M5106</link>
      <description>&lt;P&gt;"by hour" should only yield one result since you snapped to the hour with an interval of only one hour.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2013 22:20:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26441#M5106</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-10T22:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26442#M5107</link>
      <description>&lt;P&gt;access_canonical_server_name, hour, count&lt;BR /&gt;
domain.com, 1360555200.000000, 20 &lt;BR /&gt;
anotherdomain.com, 1360555200.000000, 11&lt;/P&gt;

&lt;P&gt;Do you have an idea how to solve my problem I asked on the initial question? Thank.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:17:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26442#M5107</guid>
      <dc:creator>stephan_berger</dc:creator>
      <dc:date>2020-09-28T13:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26443#M5108</link>
      <description>&lt;P&gt;I'm not sure I understand what you want yet &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2013 06:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26443#M5108</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-11T06:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26444#M5109</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;-&amp;gt; 2 hours ago&lt;BR /&gt;
access_canonical_server_name, count_of_requests&lt;BR /&gt;
domain.com, 512&lt;BR /&gt;
anotherdomain.com, 77 &lt;/P&gt;

&lt;P&gt;-&amp;gt; 1 hour ago&lt;BR /&gt;
access_canonical_server_name, count_of_requests&lt;BR /&gt;
domain.com, 65&lt;BR /&gt;
anotherdomain.com, 80&lt;/P&gt;

&lt;P&gt;As you can see, the requests for domain.com dropped dramatically in the last hour, compared to two hours ago. I want to detect such behavior. Is this clearer now? Thanks for your assistance.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:17:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26444#M5109</guid>
      <dc:creator>stephan_berger</dc:creator>
      <dc:date>2020-09-28T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Metrics That Fell by 10% in an Hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26445#M5110</link>
      <description>&lt;P&gt;So in other words if it is 8:51am you want to count the requests from 7:51am to now and compare them to the count of requests from 6:51am to 7:51am?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2013 07:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-Metrics-That-Fell-by-10-in-an-Hour/m-p/26445#M5110</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-11T07:52:34Z</dc:date>
    </item>
  </channel>
</rss>

