<?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: Defining different intervals for the Trend &amp;amp; Sparkline indicators on a single value visualization. in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623491#M51130</link>
    <description>&lt;P&gt;The sparkline is the full output of the &lt;FONT face="courier new,courier"&gt;timechart&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;tstats&lt;/FONT&gt; command.&amp;nbsp; Value is the last value of the command and the trend indicator is the difference between the last two values.&amp;nbsp; There's no way to change that.&amp;nbsp; If you can make a case for different behavior, then do so at&amp;nbsp;&lt;A href="https://ideas.splunk.com" target="_blank"&gt;https://ideas.splunk.com&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 21:33:32 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-12-06T21:33:32Z</dc:date>
    <item>
      <title>Defining different intervals for the Trend &amp; Sparkline indicators on a single value visualization.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623482#M51127</link>
      <description>&lt;P&gt;I have a simple tstats based query that looks for how many hosts have checked in over a period of time and then displays it as a single value visualization on a dashboard. The query and visualization work perfectly, but I was trying to figure out if I can get the trend indicator and the trendline to use different intervals.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats dc(host) WHERE index="$site$" earliest=-14d@d latest=@d by _time span=7d&lt;/LI-CODE&gt;&lt;P&gt;Currently, the visualization will show:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Value: The # of hosts that reported in over the past 7 days.&lt;/LI&gt;&lt;LI&gt;Trend Indicator: The difference between the last 7 days and the previous 7-day period.&lt;/LI&gt;&lt;LI&gt;Trendline: A simple line with two points showing that difference.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ideally, I'd like to be able to define a 1d interval for the trendline to communicate to the user when the increases/decreases occurred.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 19:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623482#M51127</guid>
      <dc:creator>donfarland</dc:creator>
      <dc:date>2022-12-06T19:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Defining different intervals for the Trend &amp; Sparkline indicators on a single value visualization.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623491#M51130</link>
      <description>&lt;P&gt;The sparkline is the full output of the &lt;FONT face="courier new,courier"&gt;timechart&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;tstats&lt;/FONT&gt; command.&amp;nbsp; Value is the last value of the command and the trend indicator is the difference between the last two values.&amp;nbsp; There's no way to change that.&amp;nbsp; If you can make a case for different behavior, then do so at&amp;nbsp;&lt;A href="https://ideas.splunk.com" target="_blank"&gt;https://ideas.splunk.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 21:33:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623491#M51130</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-06T21:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Defining different intervals for the Trend &amp; Sparkline indicators on a single value visualization.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623493#M51131</link>
      <description>&lt;P&gt;Thank you. I expected that was going to be the answer. I'll have to consider my use case and submit a request but will probably just take a different approach and splitting it into two visualizations.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 21:37:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623493#M51131</guid>
      <dc:creator>donfarland</dc:creator>
      <dc:date>2022-12-06T21:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Defining different intervals for the Trend &amp; Sparkline indicators on a single value visualization.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623501#M51133</link>
      <description>&lt;P&gt;To get 1day and 7day distinct counts you will first need to calculate the 1day dc() and then the 7 day(). In order to calculate the 7 day after the 1 day you need to retain ALL host values from the 1 day (by day) so you can then dc for 7 days.&lt;/P&gt;&lt;P&gt;In terms of getting the data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats values(host) as host dc(host) as dc_host_1day WHERE index="$site$" earliest=-14d@d latest=@d by _time span=1d
| bin _time span=7d 
| eventstats dc(host) as dc_host_7day by _time
| fields - host&lt;/LI-CODE&gt;&lt;P&gt;this will give you both the 1 day and 7 day dc count, however, I believe the challenge is to make the trendline work on the 1 day field, but the value to show for the 7 day field.&lt;/P&gt;&lt;P&gt;I don't believe that's going to be possible...&lt;/P&gt;&lt;P&gt;You might be better off to sit two single value panels side by side and have one show the 1 day and the other the 7 day.&lt;/P&gt;&lt;P&gt;You could also do some CSS manipulation to show one SV above the other and hide the second number. e.g. this CSS row&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row depends="$CSS$"&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
        #day1 .single-value-main-body {
          display:none !important;
        }
        #day1 .svg-container {
          top:-80px !important;
        }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;would cause the main number of the 1 day display to be hidden and the sparkline for the 1 day to be shifted up, but this is rabbit hole territory... Note that the search below is creating dummy 1 day data in my example, but this gives you an idea of what can be done with CSS.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;search base="base"&amp;gt;
          &amp;lt;query&amp;gt;| stats values(dc_host_7day) by _time
          &amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="colorBy"&amp;gt;value&amp;lt;/option&amp;gt;
        &amp;lt;option name="colorMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="numberPrecision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0x53a051","0x0877a6","0xf8be34","0xf1813f","0xdc4e41"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[0,30,70,100]&amp;lt;/option&amp;gt;
        &amp;lt;option name="showSparkline"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="showTrendIndicator"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
        &amp;lt;option name="trendColorInterpretation"&amp;gt;standard&amp;lt;/option&amp;gt;
        &amp;lt;option name="trendDisplayMode"&amp;gt;absolute&amp;lt;/option&amp;gt;
        &amp;lt;option name="unitPosition"&amp;gt;after&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="useThousandSeparators"&amp;gt;1&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
      &amp;lt;html/&amp;gt;
      &amp;lt;single id="day1"&amp;gt;
        &amp;lt;search id="base"&amp;gt;
          &amp;lt;query&amp;gt;| tstats values(host) as host dc(host) as dc_host_1day WHERE index="*" earliest=-14d@d latest=@d by _time span=1d
| eval dc_host_1day=random() % 500
| bin _time span=7d 
| eventstats dc(host) as dc_host_7day by _time
| fields - host
| table _time dc_host_1day dc_host_7day&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;1670270400.000&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;1670359017.000&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="colorBy"&amp;gt;value&amp;lt;/option&amp;gt;
        &amp;lt;option name="colorMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="numberPrecision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0x53a051","0x0877a6","0xf8be34","0xf1813f","0xdc4e41"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[0,30,70,100]&amp;lt;/option&amp;gt;
        &amp;lt;option name="showSparkline"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="showTrendIndicator"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
        &amp;lt;option name="trendColorInterpretation"&amp;gt;standard&amp;lt;/option&amp;gt;
        &amp;lt;option name="trendDisplayMode"&amp;gt;absolute&amp;lt;/option&amp;gt;
        &amp;lt;option name="unitPosition"&amp;gt;after&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="useThousandSeparators"&amp;gt;1&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 22:01:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623501#M51133</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-12-06T22:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Defining different intervals for the Trend &amp; Sparkline indicators on a single value visualization.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623585#M51142</link>
      <description>&lt;P&gt;That is a very interesting approach, but definitely a rabbit hole I'm going to avoid. I definitely think I'll just go for two visualizations as you suggest. Cleaner and simpler. It has the added benefit of being able to customize the drill-down behavior for both visualizations. The 7d can provide a list of changes for the week and the 1d can show daily counts in greater detail.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 14:04:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Defining-different-intervals-for-the-Trend-amp-Sparkline/m-p/623585#M51142</guid>
      <dc:creator>donfarland</dc:creator>
      <dc:date>2022-12-07T14:04:55Z</dc:date>
    </item>
  </channel>
</rss>

