<?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 How can I integrate this IF statement into the panel? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480881#M31528</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Below is the source for a panel on one of my dashboards. It outputs a single number that shows how many of our systems are active. Ideally this number will always be 50. We want to highlight when it is NOT 50.&lt;/P&gt;

&lt;P&gt;Here is the summary of the condition I want to add to the code below, but don't know how. I am asking if someone can please help me integrate this IF statement into the panel below. Seeing this one example will help me add these to other Splunk panels and really improve my teams effectiveness with this tool.&lt;/P&gt;

&lt;P&gt;IF number of systems is 50, hide value (making font color white would work if hiding value isn't possible). &lt;BR /&gt;
ELSE (make font color red and size 100)&lt;/P&gt;

&lt;P&gt;Actual code being used to add the above statement to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;title&amp;gt;# of Running Systems&amp;lt;/title&amp;gt;
&amp;lt;search&amp;gt;
  &amp;lt;query&amp;gt;sourcetype=prod source=*peek.log config_section_stats | stats latest(_time) as latest_log_time, latest(model_time) as latest_model_time by case, source, hostname | convert ctime(latest_log_time) | stats dc(case) as NUM_LINES&amp;lt;/query&amp;gt;
  &amp;lt;earliest&amp;gt;-15m&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;Thank you very much for any help you can provide.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2020 22:00:48 GMT</pubDate>
    <dc:creator>shane1234</dc:creator>
    <dc:date>2020-01-08T22:00:48Z</dc:date>
    <item>
      <title>How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480881#M31528</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Below is the source for a panel on one of my dashboards. It outputs a single number that shows how many of our systems are active. Ideally this number will always be 50. We want to highlight when it is NOT 50.&lt;/P&gt;

&lt;P&gt;Here is the summary of the condition I want to add to the code below, but don't know how. I am asking if someone can please help me integrate this IF statement into the panel below. Seeing this one example will help me add these to other Splunk panels and really improve my teams effectiveness with this tool.&lt;/P&gt;

&lt;P&gt;IF number of systems is 50, hide value (making font color white would work if hiding value isn't possible). &lt;BR /&gt;
ELSE (make font color red and size 100)&lt;/P&gt;

&lt;P&gt;Actual code being used to add the above statement to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;title&amp;gt;# of Running Systems&amp;lt;/title&amp;gt;
&amp;lt;search&amp;gt;
  &amp;lt;query&amp;gt;sourcetype=prod source=*peek.log config_section_stats | stats latest(_time) as latest_log_time, latest(model_time) as latest_model_time by case, source, hostname | convert ctime(latest_log_time) | stats dc(case) as NUM_LINES&amp;lt;/query&amp;gt;
  &amp;lt;earliest&amp;gt;-15m&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;Thank you very much for any help you can provide.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 22:00:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480881#M31528</guid>
      <dc:creator>shane1234</dc:creator>
      <dc:date>2020-01-08T22:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480882#M31529</link>
      <description>&lt;P&gt;` &lt;/P&gt;

&lt;P&gt;sourcetype=prod source=*peek.log config_section_stats | stats latest(_time) as latest_log_time, latest(model_time) as latest_model_time by case, source, hostname | convert ctime(latest_log_time) | stats dc(case) as NUM_LINES&lt;BR /&gt;
   -15m&lt;BR /&gt;
   now&lt;BR /&gt;
        &lt;BR /&gt;
        none&lt;BR /&gt;
        none&lt;BR /&gt;
        0&lt;BR /&gt;
        ["0x006d9c","0x006d9c","0xffffff","0xffffff","0xffffff"]&lt;BR /&gt;
        [0,50,70,100]&lt;BR /&gt;
        progressbar&lt;BR /&gt;
        1&lt;BR /&gt;
      &lt;BR /&gt;
`&lt;/P&gt;

&lt;P&gt;The range colors and the range values does that, this one will keep 0 - 50 blue and above that white. this should work, but if it doesn't let me know please&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480882#M31529</guid>
      <dc:creator>carlasteenkamp</dc:creator>
      <dc:date>2020-09-30T03:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480883#M31530</link>
      <description>&lt;P&gt;If you are using single value on the dashboard you can follow this to add rangemap to the values &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Viz/SingleValueFormatting"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.1/Viz/SingleValueFormatting&lt;/A&gt;&lt;BR /&gt;
or&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Rangemap"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Rangemap&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 05:22:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480883#M31530</guid>
      <dc:creator>jarizeloyola</dc:creator>
      <dc:date>2020-01-09T05:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480884#M31531</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form refresh="10"&amp;gt;
  &amp;lt;label&amp;gt;single visualization test&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults 
| eval  NUM_LINES=50 + (random() % 2) * -1&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&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;block&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0xdc4e41","0xffffff"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[49]&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="showSparkline"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="showTrendIndicator"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;1&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I do not know the size of the font, so please ask another person.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 12:12:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480884#M31531</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-09T12:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480885#M31532</link>
      <description>&lt;P&gt;Thank you for this. &lt;/P&gt;

&lt;P&gt;However, I am looking at just having a single value appear differently (white or hidden). In this case, "50". Everything else (above or below) should appear red. &lt;/P&gt;

&lt;P&gt;Also, I attempted to use this as a starting point to figure it out myself and received the following error: &lt;/P&gt;

&lt;P&gt;Error in 'stats' command: The argument '-15m' is invalid. &lt;/P&gt;

&lt;P&gt;Clearly I am not a programmer and am new to Splunk. I did add the missing "/query" close which resolved the error while working in source, but the above is what displays on the dashboard. &lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 16:08:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480885#M31532</guid>
      <dc:creator>shane1234</dc:creator>
      <dc:date>2020-01-09T16:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480886#M31533</link>
      <description>&lt;P&gt;Probably a dumb question, but when I use this I get the following error:&lt;/P&gt;

&lt;P&gt;Error in 'stats' command: The argument 'NUM_LINES=50' is invalid.&lt;/P&gt;

&lt;P&gt;Any idea?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 16:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480886#M31533</guid>
      <dc:creator>shane1234</dc:creator>
      <dc:date>2020-01-09T16:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480887#M31534</link>
      <description>&lt;P&gt;Just figured it out using a combination of yours and jarizeloyola's comments. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 16:33:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480887#M31534</guid>
      <dc:creator>shane1234</dc:creator>
      <dc:date>2020-01-09T16:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I integrate this IF statement into the panel?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480888#M31535</link>
      <description>&lt;P&gt;FYI, I used the format visualization option which populated the proper code into the panel, then since the format menu only allowed ranges, I used your code to modify it to a single value. Here's the result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;# of Systems&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;sourcetype=prod source=*peek.log config_section_stats | stats latest(_time) as latest_log_time, latest(model_time) as latest_model_time by case, source, hostname | convert ctime(latest_log_time) | stats dc(case) as NUM_LINES&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0xffffff","0xdc4e41"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[44]&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;1&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jan 2020 16:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-integrate-this-IF-statement-into-the-panel/m-p/480888#M31535</guid>
      <dc:creator>shane1234</dc:creator>
      <dc:date>2020-01-09T16:36:11Z</dc:date>
    </item>
  </channel>
</rss>

