<?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 display a gauge chart when null values are received? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338445#M100385</link>
    <description>&lt;P&gt;it working perfectly if i wish to change the chart to table i just have to use  am i right?&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 08:18:34 GMT</pubDate>
    <dc:creator>qygoh</dc:creator>
    <dc:date>2017-03-07T08:18:34Z</dc:date>
    <item>
      <title>How to display a gauge chart when null values are received?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338443#M100383</link>
      <description>&lt;P&gt;Hi guys i have a gauge chart which normally will display values. however i encounter issues when there is no value, how should i resolve it? i try with "noop" it seem like no working. Mind to share? Below is my search:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Customer="abc" Location="xyz"  ID2="EFF"  | eval Value=0.5 |stats avg(Value) as avgvalues | eval avgvalues=round(avgvalues,2)
| gauge avgvalues 0 0.6 1|noop
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 04:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338443#M100383</guid>
      <dc:creator>qygoh</dc:creator>
      <dc:date>2017-03-07T04:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to display a gauge chart when null values are received?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338444#M100384</link>
      <description>&lt;P&gt;You can run a base search and using &lt;STRONG&gt;preview&lt;/STRONG&gt; (or &lt;STRONG&gt;finalized&lt;/STRONG&gt;) search event handler, you can set calculated value for your Gauge Chart as a token. You can use &lt;STRONG&gt;$job.resultCount$&lt;/STRONG&gt; to identify "No Results Found" scenario and default the token to zero. See the example below, you may need to correct the base search as per what you have.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;!--Base search for Gauge Chart with default 0 if null --&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;Customer="abc" Location="xyz"  ID2="EFF"  
  | eval Value=0.5 
  |stats avg(Value) as avgvalues 
  | eval avgvalues=round(avgvalues,2)
  &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;preview&amp;gt;
      &amp;lt;!--No results, default $gaugeValue$ to zero --&amp;gt;
      &amp;lt;condition match="$job.resultCount$==0"&amp;gt;
        &amp;lt;set token="gaugeValue"&amp;gt;0&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;!--No results, default $gaugeValue$ from query --&amp;gt;
      &amp;lt;condition&amp;gt;
        &amp;lt;set token="gaugeValue"&amp;gt;$result.avgvalues$&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/preview&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults 
| eval avgvalues =$gaugeValue$
| table avgvalues
| gauge avgvalues 0 0.6 1           
          &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-1m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        ....
        ....
        ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For reference, you can check out &lt;STRONG&gt;Null Search Swapper&lt;/STRONG&gt; example in &lt;STRONG&gt;Splunk 6.x Dashboard Examples&lt;/STRONG&gt; app.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 06:01:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338444#M100384</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-07T06:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to display a gauge chart when null values are received?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338445#M100385</link>
      <description>&lt;P&gt;it working perfectly if i wish to change the chart to table i just have to use  am i right?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 08:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338445#M100385</guid>
      <dc:creator>qygoh</dc:creator>
      <dc:date>2017-03-07T08:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to display a gauge chart when null values are received?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338446#M100386</link>
      <description>&lt;P&gt;@qygoh... table with single row... yes you can but with &lt;CODE&gt;result.&amp;lt;fieldname&amp;gt;&lt;/CODE&gt; you can not only have single value even if the search returns multiple results. In other words you can replace the chart with either Single Value, Status Indicator(Custom Visualization), Other Gauges or HTML panel.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 19:56:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338446#M100386</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-07T19:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to display a gauge chart when null values are received?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338447#M100387</link>
      <description>&lt;P&gt;@niketnilay thank you very much for your help and suggestion&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 00:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-a-gauge-chart-when-null-values-are-received/m-p/338447#M100387</guid>
      <dc:creator>qygoh</dc:creator>
      <dc:date>2017-03-08T00:42:52Z</dc:date>
    </item>
  </channel>
</rss>

