<?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 Null/empty data and sparkline in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Null-empty-data-and-sparkline/m-p/61812#M15255</link>
    <description>&lt;P&gt;Hi, I've got some data that reports the number of users once per day, like:&lt;/P&gt;

&lt;P&gt;users=1000&lt;BR /&gt;&lt;BR /&gt;
users=1500&lt;BR /&gt;&lt;BR /&gt;
users=9001&lt;/P&gt;

&lt;P&gt;I'm trying to make a simple sparkline which shows this over the last 90 days. My current search is:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mysearch | chart latest(users) sparkline(avg(users),1d)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This works, but there is a problem: the sparkline displays a value of 0 as the first or last value, depending on when the search is run. It assumes that the value is 0 when the search time range includes part of a day that does not have data. For example, if the search includes the last 2 hours of Tuesday, it will assume a 0, because the data from Tuesday was reported at 4 am.&lt;/P&gt;

&lt;P&gt;So, how do I get sparkline to ignore these values, or get the search to not include "partial" days? I've tried &lt;CODE&gt;usenull=f&lt;/CODE&gt; in the &lt;CODE&gt;chart&lt;/CODE&gt; command, but it doesn't seem to work for sparklines. I realize that making this a scheduled search would probably work if I get the time ranges just right, but I feel like there is a more elegant way to do it, and I don't want it to break if the reporting frequency changes or moves to a different time.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Mon, 17 Sep 2012 17:38:58 GMT</pubDate>
    <dc:creator>rereeser</dc:creator>
    <dc:date>2012-09-17T17:38:58Z</dc:date>
    <item>
      <title>Null/empty data and sparkline</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Null-empty-data-and-sparkline/m-p/61812#M15255</link>
      <description>&lt;P&gt;Hi, I've got some data that reports the number of users once per day, like:&lt;/P&gt;

&lt;P&gt;users=1000&lt;BR /&gt;&lt;BR /&gt;
users=1500&lt;BR /&gt;&lt;BR /&gt;
users=9001&lt;/P&gt;

&lt;P&gt;I'm trying to make a simple sparkline which shows this over the last 90 days. My current search is:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mysearch | chart latest(users) sparkline(avg(users),1d)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This works, but there is a problem: the sparkline displays a value of 0 as the first or last value, depending on when the search is run. It assumes that the value is 0 when the search time range includes part of a day that does not have data. For example, if the search includes the last 2 hours of Tuesday, it will assume a 0, because the data from Tuesday was reported at 4 am.&lt;/P&gt;

&lt;P&gt;So, how do I get sparkline to ignore these values, or get the search to not include "partial" days? I've tried &lt;CODE&gt;usenull=f&lt;/CODE&gt; in the &lt;CODE&gt;chart&lt;/CODE&gt; command, but it doesn't seem to work for sparklines. I realize that making this a scheduled search would probably work if I get the time ranges just right, but I feel like there is a more elegant way to do it, and I don't want it to break if the reporting frequency changes or moves to a different time.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2012 17:38:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Null-empty-data-and-sparkline/m-p/61812#M15255</guid>
      <dc:creator>rereeser</dc:creator>
      <dc:date>2012-09-17T17:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Null/empty data and sparkline</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Null-empty-data-and-sparkline/m-p/61813#M15256</link>
      <description>&lt;P&gt;Nevermind, I found it. I forgot I could use the "snap to time unit"  for my time ranges:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=-30d@d&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2012 17:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Null-empty-data-and-sparkline/m-p/61813#M15256</guid>
      <dc:creator>rereeser</dc:creator>
      <dc:date>2012-09-18T17:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Null/empty data and sparkline</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Null-empty-data-and-sparkline/m-p/61814#M15257</link>
      <description>&lt;P&gt;For next ones who would a solution without changing the time unit :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makemv delim="£" setsv=true YOURSPARKLINEFIELD|eval YOURSPARKLINEFIELD=replace((YOURSPARKLINEFIELD),",0","")|makemv delim="," setsv=true YOURSPARKLINEFIELD
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will delete all 0 values generated by Splunk stats sparkline() function that you dont want to see [Often the first and last value].&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2013 09:03:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Null-empty-data-and-sparkline/m-p/61814#M15257</guid>
      <dc:creator>timmalos</dc:creator>
      <dc:date>2013-09-27T09:03:20Z</dc:date>
    </item>
  </channel>
</rss>

