<?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: Replace Null values in xyseries chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152708#M42784</link>
    <description>&lt;P&gt;No, it doesn't address the issue that I can't refer to k/v pairs where v=0, whether it's filled by fillnull or not.  The crux of my problem isn't a good way to make a value=0, it that I can't use further logic to say "when value=0, do X"&lt;/P&gt;</description>
    <pubDate>Wed, 13 Aug 2014 18:35:04 GMT</pubDate>
    <dc:creator>essklau</dc:creator>
    <dc:date>2014-08-13T18:35:04Z</dc:date>
    <item>
      <title>Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152704#M42780</link>
      <description>&lt;P&gt;Hello, Splunkers&lt;/P&gt;

&lt;P&gt;I have a search of &lt;CODE&gt;index=sql | bucket span=1h _time | stats count by _time source  | xyseries _time,source,count&lt;/CODE&gt; which is nice because I can use a where clause to act on values of count &lt;EM&gt;except&lt;/EM&gt; if the value is zero/null. There are plenty of "cells" containing no value at all that I would like to replace with "0", or if I could even refer to it directly, do so. &lt;/P&gt;

&lt;P&gt;However, I've failed with "if", "isnull", and "where count NOT &amp;gt;= 1" so far, and I can't figure out how to change the value of a zero/null "cell" much less how to change its value.&lt;/P&gt;

&lt;P&gt;Any takers?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2014 15:43:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152704#M42780</guid>
      <dc:creator>essklau</dc:creator>
      <dc:date>2014-07-22T15:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152705#M42781</link>
      <description>&lt;P&gt;You can use fillnull command to replace NULL values with 0.&lt;/P&gt;

&lt;P&gt;Also, Try using timechart instead of bucket..stats...xyseries combination.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sql | timechart span=1h count by source | fillnull value=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Jul 2014 15:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152705#M42781</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-22T15:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152706#M42782</link>
      <description>&lt;P&gt;Timechart doesn't let me use where clause, but I'll take (try) that fillnull. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; THx.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2014 17:00:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152706#M42782</guid>
      <dc:creator>essklau</dc:creator>
      <dc:date>2014-07-22T17:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152707#M42783</link>
      <description>&lt;P&gt;Hi @essklau&lt;/P&gt;

&lt;P&gt;Did the fillnull command solve your issue?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2014 23:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152707#M42783</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2014-07-29T23:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152708#M42784</link>
      <description>&lt;P&gt;No, it doesn't address the issue that I can't refer to k/v pairs where v=0, whether it's filled by fillnull or not.  The crux of my problem isn't a good way to make a value=0, it that I can't use further logic to say "when value=0, do X"&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 18:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152708#M42784</guid>
      <dc:creator>essklau</dc:creator>
      <dc:date>2014-08-13T18:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152709#M42785</link>
      <description>&lt;P&gt;It's not a data type issue either, meaning that "0" isn't being read as a string unexpectedly.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 18:36:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152709#M42785</guid>
      <dc:creator>essklau</dc:creator>
      <dc:date>2014-08-13T18:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152710#M42786</link>
      <description>&lt;P&gt;Hi essklau &lt;/P&gt;

&lt;P&gt;try this code source it will be done&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=sql| bucket span=1h _time | stats count by _time source | xyseries _time,source,count |fillnull value=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Dec 2014 11:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152710#M42786</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2014-12-16T11:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152711#M42787</link>
      <description>&lt;P&gt;Your initial post seems to indicate you are doing a ... | stats | where | xyseries but your query doesn't read like that. The fillnull is an option but would be done as ... | stats | fillnull | xyseries. I've found that once the data is in a chart/table view (chart or timechart) you aren't able to use a where on the field count (or whatever function used) as it doesn't exist anymore once you've moved into that display mode (highly likely a more technical term for that =). &lt;/P&gt;

&lt;P&gt;At any rate if you are using 6.x+ you could do the following. There are some nuances with fields that don't have alphanumeric names which I assume is there given you are using source. That is why you would use the single quotes around  though.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sql | bucket span=1h _time | chart count over _time by source | foreach * [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = if(isnull('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'), 0, '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You don't really have to do the chart bit but wanted to show that as a different way to do the stats and then xyseries. Of course the benefit of going that route is you CAN insert a where or sort between the two unlike chart. I always get my xy mixed up when doing chart over by so might have to reverse those if you give it a try. &lt;/P&gt;

&lt;P&gt;Incidentally it just hit me that I wonder if once you are in that 'chart' view you could do a | multikv. Probably not though.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 12:29:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152711#M42787</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2014-12-16T12:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152712#M42788</link>
      <description>&lt;P&gt;Hi essklau,&lt;/P&gt;

&lt;P&gt;take a look at this &lt;A href="http://answers.splunk.com/answers/176466/how-to-use-eval-if-there-is-no-result-from-the-bas-1.html"&gt;http://answers.splunk.com/answers/176466/how-to-use-eval-if-there-is-no-result-from-the-bas-1.html&lt;/A&gt; to get an idea how to do such a thing if your base search returns no events.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 12:32:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152712#M42788</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-12-16T12:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Null values in xyseries chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152713#M42789</link>
      <description>&lt;P&gt;index=sql | bucket span=1h _time | stats count by _time source | xyseries _time,source,count|fillnull&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 19:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-Null-values-in-xyseries-chart/m-p/152713#M42789</guid>
      <dc:creator>ryhluc01</dc:creator>
      <dc:date>2019-02-21T19:08:09Z</dc:date>
    </item>
  </channel>
</rss>

