Dashboards & Visualizations

how to create trend showing increase or decrease in count from yesterday to today in single value

umsundar2015
Path Finder

hi ,

my requirement is to show a single value graph with difference from yesterday scope count .the difference should be shown near the total count of today with increase or decrease symbol .

ex: 4001 then symbol with difference

please help me with it

0 Karma
1 Solution

niketn
Legend

@umsundar2015 as stated by @kmorris_splunk you should be able to use Single Value Chart with Trending to depict such kind of data. Following is a run anywhere dashboard based on Splunk's _internal index:

alt text

Following is Simple XML code for run anywhere example in the screenshot:

<dashboard>
  <label>Trend Today Compared to Previous Day</label>
  <row>
    <panel>
      <single>
        <search>
          <query>index=_internal sourcetype=splunkd log_level!="INFO" earliest=-1d@d latest=now
| timechart span=1d count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorBy">trend</option>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="numberPrecision">0</option>
        <option name="rangeColors">["0x65a637","0x6db7c6","0xf7bc38","0xf58f39","0xd93f3c"]</option>
        <option name="rangeValues">[0,30,70,100]</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>
        <option name="trendColorInterpretation">inverse</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="unitPosition">after</option>
        <option name="useColors">1</option>
        <option name="useThousandSeparators">1</option>
      </single>
    </panel>
  </row>
</dashboard>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@umsundar2015 as stated by @kmorris_splunk you should be able to use Single Value Chart with Trending to depict such kind of data. Following is a run anywhere dashboard based on Splunk's _internal index:

alt text

Following is Simple XML code for run anywhere example in the screenshot:

<dashboard>
  <label>Trend Today Compared to Previous Day</label>
  <row>
    <panel>
      <single>
        <search>
          <query>index=_internal sourcetype=splunkd log_level!="INFO" earliest=-1d@d latest=now
| timechart span=1d count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorBy">trend</option>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="numberPrecision">0</option>
        <option name="rangeColors">["0x65a637","0x6db7c6","0xf7bc38","0xf58f39","0xd93f3c"]</option>
        <option name="rangeValues">[0,30,70,100]</option>
        <option name="showSparkline">1</option>
        <option name="showTrendIndicator">1</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>
        <option name="trendColorInterpretation">inverse</option>
        <option name="trendDisplayMode">absolute</option>
        <option name="unitPosition">after</option>
        <option name="useColors">1</option>
        <option name="useThousandSeparators">1</option>
      </single>
    </panel>
  </row>
</dashboard>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

skoelpin
SplunkTrust
SplunkTrust

You will need to use relative_time and eval to calculate the number from yesterday vs the number from today which will then display as a single value. What is your timespan you want to compare? Yesterdays value compared to todays value?

0 Karma

umsundar2015
Path Finder

yes , i need yesterday value compared with today .can you please help me with code

0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

Take a look at the Splunk Dashboard Examples app:

https://splunkbase.splunk.com/app/1603/

Under Single Value Elements section there are examples.

alt text

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...