<?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 remove consecutive duplicate values by host from custom perfmon counters? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-consecutive-duplicate-values-by-host-from-custom/m-p/202369#M58697</link>
    <description>&lt;P&gt;Assuming you have field &lt;STRONG&gt;host&lt;/STRONG&gt; (which has host values) and field &lt;STRONG&gt;Value&lt;/STRONG&gt; (which has Servicebus/ResponseTime) , please try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Response Time" instance="Service"
| sort host
| fields host, Value
| dedup host, Value consecutive=true
| stats avg(Value) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 Nov 2016 06:06:46 GMT</pubDate>
    <dc:creator>gokadroid</dc:creator>
    <dc:date>2016-11-02T06:06:46Z</dc:date>
    <item>
      <title>How to remove consecutive duplicate values by host from custom perfmon counters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-consecutive-duplicate-values-by-host-from-custom/m-p/202368#M58696</link>
      <description>&lt;P&gt;Hi There, &lt;/P&gt;

&lt;P&gt;I am trying to figure out how to remove duplicates in a custom perfmon counters data that is exported to Splunk. &lt;/P&gt;

&lt;P&gt;We have a custom perfmon counter implemented for a service, which reports response time of a service when ever it is called. Otherwise, it will be returning the same old data from the last service response until the new request is served. The same service is hosted on multiple hosts and all the host report perfmon data. &lt;/P&gt;

&lt;P&gt;I am trying to find the average by removing all the consecutive duplicates by host and get an average. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Response Time" instance="Service" | dedup Value host consecutive=true | chart avg(Value)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search is not accurate. &lt;/P&gt;

&lt;P&gt;Example Data :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host 1: 
Time              Servicebus/ResponseTime    
00:00:01                   460
00:00:02                   460
00:00:03                   520
00:00:04                   520
00:00:05                   630
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Host 2: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time              Servicebus/ResponseTime    
00:00:01                   480
00:00:02                   480
00:00:03                   590
00:00:04                   590
00:00:05                   610
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since we are sending data to Splunk every 1s from all the hosts, this is how the data in the Splunk is represented (as per my knowledge). See below. In this case, the above search is not removing the duplicates. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time              Servicebus/ResponseTime     Host
00:00:01                   460                                Host 1
00:00:01                   480                                Host 2
00:00:02                   460                                Host 1
00:00:02                  480                                Host 2
00:00:03                   520                                Host 1
00:00:03                   590                                Host 2
00:00:04                   520                                Host 1
00:00:04                   590                                Host 2
00:00:05                   630                                Host 1
00:00:05                   610                                 Host 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone help me on how to remove consecutive duplicates by host? &lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Dayananda&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 22:31:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-consecutive-duplicate-values-by-host-from-custom/m-p/202368#M58696</guid>
      <dc:creator>dayananda7449</dc:creator>
      <dc:date>2016-11-01T22:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove consecutive duplicate values by host from custom perfmon counters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-consecutive-duplicate-values-by-host-from-custom/m-p/202369#M58697</link>
      <description>&lt;P&gt;Assuming you have field &lt;STRONG&gt;host&lt;/STRONG&gt; (which has host values) and field &lt;STRONG&gt;Value&lt;/STRONG&gt; (which has Servicebus/ResponseTime) , please try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Response Time" instance="Service"
| sort host
| fields host, Value
| dedup host, Value consecutive=true
| stats avg(Value) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 06:06:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-consecutive-duplicate-values-by-host-from-custom/m-p/202369#M58697</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-02T06:06:46Z</dc:date>
    </item>
  </channel>
</rss>

