<?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: Single Value color change based on diff in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23411#M866</link>
    <description>&lt;P&gt;gnovak,&lt;/P&gt;

&lt;P&gt;In order to achieve this both saved searches are going to need to be aware of each other.  It would help if we had the syntax for these two searches, but I should be able to speak generally enough.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;## Append "to send" and "sent" searches and compare "to_send_count" to "sent_count"
## If counts equate, set range == low, else set range == severe.
&amp;lt;balance_email_to_send_asia&amp;gt; | stats count as to_send_count | append[&amp;lt;balance_email_sent_asia&amp;gt; | stats count as sent_count] | eval range=if(to_send_count==sent_count,low,severe)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could use the above search to drive both SingleValue reports, one report displays &lt;CODE&gt;"to_send_count"&lt;/CODE&gt; and the other &lt;CODE&gt;"sent_count"&lt;/CODE&gt;.  The trick is that we get both counts in a single search so they can be compared and the value of &lt;CODE&gt;"range"&lt;/CODE&gt; set appropriately.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2011 16:30:30 GMT</pubDate>
    <dc:creator>hazekamp</dc:creator>
    <dc:date>2011-06-07T16:30:30Z</dc:date>
    <item>
      <title>Single Value color change based on diff</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23408#M863</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;I have a dashboard created that evaluates the number of emails that should be sent and then the ACTUAL number of emails that were sent for a particular location.&lt;/P&gt;

&lt;P&gt;This section of the dashboard produces 2 numbers, TotalEmailsToSend and TotalEmailsSent.&lt;/P&gt;

&lt;P&gt;Each one of these values is put into a single value box on my dashboard.&lt;/P&gt;

&lt;P&gt;Now the fun part.  Both numbers need to match.  If they do not, the non matching number should turn red while the other is green.  If both numbers match, I would like them to both be green.&lt;/P&gt;

&lt;P&gt;The TotalEmailsSent is the number that will differ if there was a problem.  That number needs to turn red if it does not match the TotalEmailsToSend.  Here is the code from my dashboard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;html&amp;gt;
  &amp;lt;h1&amp;gt;&amp;lt;b&amp;gt;ASIA - Last 24 Hours&amp;lt;/b&amp;gt;&amp;lt;/h1&amp;gt;
  &amp;lt;a href="https://lists.afilias.info/lurker/search/20121201.000000.00000000@ml:asia cc-notify,sb:balance,sb:notification.en.html"&amp;gt;Check ASIA stats on Lurker&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;
  &amp;lt;/html&amp;gt;
&amp;lt;single&amp;gt;
      &amp;lt;searchName&amp;gt;balance_email_to_send_asia&amp;lt;/searchName&amp;gt;
      &amp;lt;fields&amp;gt;TotalEmailsToSend&amp;lt;/fields&amp;gt;
      &amp;lt;option name="beforeLabel"&amp;gt;Total Emails To Send&amp;lt;/option&amp;gt;
      &amp;lt;option name="linkView"&amp;gt;flashtimeline&amp;lt;/option&amp;gt;
      &amp;lt;option name="linkSearch"&amp;gt;sourcetype="cron_BalanceEmail" source="*asia*" starthoursago="24" Registrar="*" | eval Registrar=lower(Registrar)
&amp;lt;/option&amp;gt;
    &amp;lt;/single&amp;gt;
&amp;lt;single&amp;gt;
      &amp;lt;searchName&amp;gt;balance_email_sent_asia&amp;lt;/searchName&amp;gt;
      &amp;lt;fields&amp;gt;TotalEmailsSent&amp;lt;/fields&amp;gt;
      &amp;lt;option name="beforeLabel"&amp;gt;Total Emails Sent&amp;lt;/option&amp;gt;
      &amp;lt;option name="linkView"&amp;gt;flashtimeline&amp;lt;/option&amp;gt;
      &amp;lt;option name="linkSearch"&amp;gt;sourcetype="cron_BalanceEmail" source="*asia*" starthoursago="24" Registrar="*" | eval Registrar=lower(Registrar)
&amp;lt;/option&amp;gt;
    &amp;lt;/single&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From reading about how to do a color change, it looks like they want a "range" to work off of in regards to the color change.  In this case, I have no idea what the values would be, just that they both need to match and if they don't, the non matching one should be red.&lt;/P&gt;

&lt;P&gt;Also I see that in the examples most people were putting their search in the code for the dashboard where I am using SearchName.&lt;/P&gt;

&lt;P&gt;After explaining all of this, is what I am trying to do even possible?  &lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2011 19:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23408#M863</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-06-06T19:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Single Value color change based on diff</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23409#M864</link>
      <description>&lt;P&gt;I was also referencing this link as well to get ideas...&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/24210/single-value-module-question"&gt;http://splunk-base.splunk.com/answers/24210/single-value-module-question&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2011 22:50:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23409#M864</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-06-06T22:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Single Value color change based on diff</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23410#M865</link>
      <description>&lt;P&gt;I'm wondering can you do something like:&lt;/P&gt;

&lt;P&gt;field=TotalEmailsSent red=TotalEmailsSent &amp;lt; TotalEmailsToSend default=green&lt;/P&gt;

&lt;P&gt;or something like that....I could try it and see what happens perhaps....&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2011 15:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23410#M865</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-06-07T15:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Single Value color change based on diff</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23411#M866</link>
      <description>&lt;P&gt;gnovak,&lt;/P&gt;

&lt;P&gt;In order to achieve this both saved searches are going to need to be aware of each other.  It would help if we had the syntax for these two searches, but I should be able to speak generally enough.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;## Append "to send" and "sent" searches and compare "to_send_count" to "sent_count"
## If counts equate, set range == low, else set range == severe.
&amp;lt;balance_email_to_send_asia&amp;gt; | stats count as to_send_count | append[&amp;lt;balance_email_sent_asia&amp;gt; | stats count as sent_count] | eval range=if(to_send_count==sent_count,low,severe)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could use the above search to drive both SingleValue reports, one report displays &lt;CODE&gt;"to_send_count"&lt;/CODE&gt; and the other &lt;CODE&gt;"sent_count"&lt;/CODE&gt;.  The trick is that we get both counts in a single search so they can be compared and the value of &lt;CODE&gt;"range"&lt;/CODE&gt; set appropriately.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2011 16:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23411#M866</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2011-06-07T16:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Single Value color change based on diff</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23412#M867</link>
      <description>&lt;P&gt;For some reason it won't let me comment my answer so I had to put it here as an "answer"&lt;/P&gt;

&lt;P&gt;Balance_email_sent_asia&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="cron_BalanceEmail" source="*asia*" starthoursago="24" BalanceEmail sent | rex field=_raw "\[BalanceEmail\](?&amp;lt;TotalEmailsSent&amp;gt;[\d]+) of (?&amp;lt;TotalEmailsToSend&amp;gt;[\d]+) of email notification sent\." | search TotalEmailsSent="*" | chart sum(TotalEmailsSent)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Balance_email_to_send_asia&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="cron_BalanceEmail" source="*asia*" starthoursago="24" BalanceEmail sent | rex field=_raw "\[BalanceEmail\](?&amp;lt;TotalEmailsSent&amp;gt;[\d]+) of (?&amp;lt;TotalEmailsToSend&amp;gt;[\d]+) of email notification sent\." | search TotalEmailsToSend="*" | chart sum(TotalEmailsToSend)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23412#M867</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T09:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Single Value color change based on diff</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23413#M868</link>
      <description>&lt;P&gt;gnovak, looking @ your searches the approach I outlined above is correct.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2011 21:15:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23413#M868</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2011-06-07T21:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Single Value color change based on diff</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23414#M869</link>
      <description>&lt;P&gt;this did eventually work...thanks&lt;/P&gt;</description>
      <pubDate>Mon, 02 Apr 2012 20:59:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Single-Value-color-change-based-on-diff/m-p/23414#M869</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-04-02T20:59:18Z</dc:date>
    </item>
  </channel>
</rss>

