<?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 Splunk replaces zero with null values. Chart Avg(value) omits all those null values, with this avg result is not correct. How to fix this? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244489#M189059</link>
    <description>&lt;P&gt;Hi Everyone,  I am a newbie to splunk. We are using splunk to monitor our custom perfmon counters. see the below search query. While performing avg on one of the counters, I am not getting the right result as i expect. I tried with fillnull and so on. Still the same issue. I can fill nulls but i can't those values of zero's in to consideration while calculating average. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Sent/sec" instance="ABC" host ="XYZ" | Timechart avg(Value) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result from the above query. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-06-27 23:46:00      
2016-06-27 23:47:00     10
2016-06-27 23:48:00     10
2016-06-27 23:49:00      
2016-06-27 23:50:00     10
2016-06-27 23:51:00      
2016-06-27 23:52:00      
2016-06-27 23:53:00     10
2016-06-27 23:54:00      
2016-06-27 23:55:00      
2016-06-27 23:56:00     10
2016-06-27 23:57:00      
2016-06-27 23:58:00      
2016-06-27 23:59:00     10
2016-06-28 00:00:00      
2016-06-28 00:01:00     10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Below is the query that i use to calculate average. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Sent/sec" instance="ABC" host ="XYZ" | chart avg(Value) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result from above query is &lt;CODE&gt;10&lt;/CODE&gt; (since i have 7 event where data is non zero, sum all the values and divided by the total events = 70/7 = 10) . This is not the result what i am looking for. &lt;/P&gt;

&lt;P&gt;Expected Result is 70/16 = &lt;CODE&gt;4.375&lt;/CODE&gt; . (I have 16 instances of data being reported in the timechart)&lt;/P&gt;

&lt;P&gt;Can someone help me out how to fix this issue? &lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Dayananda&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2016 01:59:24 GMT</pubDate>
    <dc:creator>dayananda7449</dc:creator>
    <dc:date>2016-07-06T01:59:24Z</dc:date>
    <item>
      <title>Splunk replaces zero with null values. Chart Avg(value) omits all those null values, with this avg result is not correct. How to fix this?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244489#M189059</link>
      <description>&lt;P&gt;Hi Everyone,  I am a newbie to splunk. We are using splunk to monitor our custom perfmon counters. see the below search query. While performing avg on one of the counters, I am not getting the right result as i expect. I tried with fillnull and so on. Still the same issue. I can fill nulls but i can't those values of zero's in to consideration while calculating average. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Sent/sec" instance="ABC" host ="XYZ" | Timechart avg(Value) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result from the above query. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-06-27 23:46:00      
2016-06-27 23:47:00     10
2016-06-27 23:48:00     10
2016-06-27 23:49:00      
2016-06-27 23:50:00     10
2016-06-27 23:51:00      
2016-06-27 23:52:00      
2016-06-27 23:53:00     10
2016-06-27 23:54:00      
2016-06-27 23:55:00      
2016-06-27 23:56:00     10
2016-06-27 23:57:00      
2016-06-27 23:58:00      
2016-06-27 23:59:00     10
2016-06-28 00:00:00      
2016-06-28 00:01:00     10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Below is the query that i use to calculate average. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Sent/sec" instance="ABC" host ="XYZ" | chart avg(Value) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result from above query is &lt;CODE&gt;10&lt;/CODE&gt; (since i have 7 event where data is non zero, sum all the values and divided by the total events = 70/7 = 10) . This is not the result what i am looking for. &lt;/P&gt;

&lt;P&gt;Expected Result is 70/16 = &lt;CODE&gt;4.375&lt;/CODE&gt; . (I have 16 instances of data being reported in the timechart)&lt;/P&gt;

&lt;P&gt;Can someone help me out how to fix this issue? &lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Dayananda&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 01:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244489#M189059</guid>
      <dc:creator>dayananda7449</dc:creator>
      <dc:date>2016-07-06T01:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk replaces zero with null values. Chart Avg(value) omits all those null values, with this avg result is not correct. How to fix this?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244490#M189060</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon collection=ServiceBus counter="Sent/sec" instance="ABC" host ="XYZ" | timechart avg(Value) AS Value | fillnull value="0" Value | chart avg(Value)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jul 2016 19:24:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244490#M189060</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-07T19:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk replaces zero with null values. Chart Avg(value) omits all those null values, with this avg result is not correct. How to fix this?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244491#M189061</link>
      <description>&lt;P&gt;We resolved this issue by adding showZeroValue = 1 in the inputs.config file for each and every category where we need splunk to captured zero value data while forwarding the data to splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 17:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244491#M189061</guid>
      <dc:creator>dayananda7449</dc:creator>
      <dc:date>2016-11-02T17:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk replaces zero with null values. Chart Avg(value) omits all those null values, with this avg result is not correct. How to fix this?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244492#M189062</link>
      <description>&lt;P&gt;This is also relevant if you don't want to use the fillnull command. There's an option in the visualization tab.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/474799/how-to-delete-data-points-with-null-values-by-host.html"&gt;https://answers.splunk.com/answers/474799/how-to-delete-data-points-with-null-values-by-host.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 21:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-replaces-zero-with-null-values-Chart-Avg-value-omits-all/m-p/244492#M189062</guid>
      <dc:creator>stoutrw</dc:creator>
      <dc:date>2019-05-22T21:32:51Z</dc:date>
    </item>
  </channel>
</rss>

