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!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...