<?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 Compare two counter values in time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48597#M11591</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to write a query to compare performance counter's values over 20 min span where the counter values change more than 1000.&lt;/P&gt;

&lt;P&gt;Your help is appreciated! &lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2013 20:08:22 GMT</pubDate>
    <dc:creator>jcl_tw0</dc:creator>
    <dc:date>2013-08-27T20:08:22Z</dc:date>
    <item>
      <title>Compare two counter values in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48597#M11591</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to write a query to compare performance counter's values over 20 min span where the counter values change more than 1000.&lt;/P&gt;

&lt;P&gt;Your help is appreciated! &lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2013 20:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48597#M11591</guid>
      <dc:creator>jcl_tw0</dc:creator>
      <dc:date>2013-08-27T20:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two counter values in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48598#M11592</link>
      <description>&lt;P&gt;Can you provide some sample events or context?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 11:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48598#M11592</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2013-09-10T11:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two counter values in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48599#M11593</link>
      <description>&lt;P&gt;For example&lt;BR /&gt;
 - 9/10/13 3:00 PM - counter 1, counter value 13240 &lt;BR /&gt;
 - 9/10/13 3:00 PM - counter 2, counter value 12700 &lt;BR /&gt;
 - 9/10/13 3:10 PM - counter 1, counter value 13340&lt;BR /&gt;
 - 9/10/13 3:10 PM - counter 2, counter value 13800 &lt;BR /&gt;
 - 9/10/13 3:20 PM - counter 1, counter value 13430 &lt;BR /&gt;
 - 9/10/13 3:20 PM - counter 2, counter value 14850&lt;BR /&gt;
 - 9/10/13 3:30 PM - counter 1, counter value 15200 &lt;BR /&gt;
 - 9/10/13 3:30 PM - counter 2, counter value 16200 &lt;/P&gt;

&lt;P&gt;In the span of 20 minutes between 3:00 PM to 3:30 PM which counter has counter value changes less than 1000. Answer is counter 1 bet 3:00 PM to 3:20 PM, value 190&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 01:05:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48599#M11593</guid>
      <dc:creator>jcl_tw0</dc:creator>
      <dc:date>2013-09-11T01:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two counter values in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48600#M11594</link>
      <description>&lt;P&gt;I think you can try below command :&lt;BR /&gt;
sourcetype=counter | bucket _time span=20m | stats min(counter_value) as min_cv max(counter_value) as max_cv by counter, _time | eval diff = max_cv- min_cv | search diff&amp;lt;1000&lt;/P&gt;

&lt;P&gt;by the way, if your time span is 20 minutes , the answer should be counter 1 between 3:00:00pm to 3:19:59pm ( not 3:20:00pm) value=100 , 3:20:00 is the beginning of next 20 minutes , right ?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:44:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48600#M11594</guid>
      <dc:creator>dmlee</dc:creator>
      <dc:date>2020-09-28T14:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two counter values in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48601#M11595</link>
      <description>&lt;P&gt;I have combine data from 20 minutes before the most recent data.&lt;BR /&gt;
But is long ...&lt;/P&gt;

&lt;P&gt;sourcetype=counter|eval key=_time.counter|rename value as base_value|table key,_time,counter,base_value|join key[search sourcetype=counter|eval key=round(relative_time(_time,"-20m@m")).counter|rename _time as ago_time,value as ago_value|table key,ago_time,counter,ago_value]|eval period=strftime(_time,"%Y/%m/%d %H:%M-").strftime(ago_time,"%H:%M")|eval difference=abs(base_value-ago_value)|table period,counter,difference|where difference&amp;lt;1000&lt;/P&gt;

&lt;P&gt;(result)&lt;BR /&gt;
&lt;IMG src="http://splunk-base.splunk.com//storage/sample_10.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:44:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48601#M11595</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2020-09-28T14:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two counter values in time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48602#M11596</link>
      <description>&lt;P&gt;I ran the query but the CounterValue, min_cv and max_cv values are the same so the diff between min_cv and max_cv is 0&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:47:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-counter-values-in-time/m-p/48602#M11596</guid>
      <dc:creator>jcl_tw0</dc:creator>
      <dc:date>2020-09-28T14:47:20Z</dc:date>
    </item>
  </channel>
</rss>

