<?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: range status in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124257#M33589</link>
    <description>&lt;P&gt;You could: &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;get the latest value using the first() option to stats&lt;/LI&gt;
&lt;LI&gt;use eval and if to set a numeric value for State whether it is on and off&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;use rangemap and some custom css to set the icon&lt;/P&gt;

&lt;P&gt;index=xx sourcetype="yyy" | stats first(State) as State | eval StateBool = if (State=="On", 0, 1) | rangemap field=StateBool low=0-0 severe=1-1&lt;BR /&gt;
You will need some custom css to add the icon to the dashboard. Checkout the Splunk 6 Dashboard examples app: &lt;A href="https://apps.splunk.com/app/1603/"&gt;https://apps.splunk.com/app/1603/&lt;/A&gt; and the "Single Value Decorations" example.&lt;/P&gt;

&lt;P&gt;Dashboard Panel:&lt;BR /&gt;
&lt;PANEL&gt;&lt;BR /&gt;
 &lt;SINGLE&gt;&lt;BR /&gt;
  &lt;SEARCHSTRING&gt;index=xx sourcetype="yyy" | stats first(State) as State | eval StateBool = if (State=="On", 0, 1) | rangemap field=StateBool low=0-0 severe=1-1&lt;/SEARCHSTRING&gt;&lt;BR /&gt;
  &lt;EARLIESTTIME&gt;-15m&lt;/EARLIESTTIME&gt;&lt;BR /&gt;
  &lt;LATESTTIME&gt;now&lt;/LATESTTIME&gt;&lt;BR /&gt;
  range&lt;BR /&gt;
  State&lt;BR /&gt;
  icon-only&lt;BR /&gt;
 &lt;/SINGLE&gt;&lt;BR /&gt;
&lt;/PANEL&gt;&lt;BR /&gt;
This will show a green "On", or a red value of "State" until the css is set, when you will get the icons.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Sat, 13 Sep 2014 20:26:59 GMT</pubDate>
    <dc:creator>datasearchninja</dc:creator>
    <dc:date>2014-09-13T20:26:59Z</dc:date>
    <item>
      <title>range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124256#M33588</link>
      <description>&lt;P&gt;how do i use range to display green tick or red cross for the following&lt;/P&gt;

&lt;P&gt;index=xx sourcetype="yyy" State!="On" &lt;/P&gt;

&lt;P&gt;If 'State' not equal to 'On' display red cross else green tick. I want it to take the latest event to check.&lt;/P&gt;

&lt;P&gt;Thanks in advance for your help&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2014 19:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124256#M33588</guid>
      <dc:creator>kris99</dc:creator>
      <dc:date>2014-09-13T19:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124257#M33589</link>
      <description>&lt;P&gt;You could: &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;get the latest value using the first() option to stats&lt;/LI&gt;
&lt;LI&gt;use eval and if to set a numeric value for State whether it is on and off&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;use rangemap and some custom css to set the icon&lt;/P&gt;

&lt;P&gt;index=xx sourcetype="yyy" | stats first(State) as State | eval StateBool = if (State=="On", 0, 1) | rangemap field=StateBool low=0-0 severe=1-1&lt;BR /&gt;
You will need some custom css to add the icon to the dashboard. Checkout the Splunk 6 Dashboard examples app: &lt;A href="https://apps.splunk.com/app/1603/"&gt;https://apps.splunk.com/app/1603/&lt;/A&gt; and the "Single Value Decorations" example.&lt;/P&gt;

&lt;P&gt;Dashboard Panel:&lt;BR /&gt;
&lt;PANEL&gt;&lt;BR /&gt;
 &lt;SINGLE&gt;&lt;BR /&gt;
  &lt;SEARCHSTRING&gt;index=xx sourcetype="yyy" | stats first(State) as State | eval StateBool = if (State=="On", 0, 1) | rangemap field=StateBool low=0-0 severe=1-1&lt;/SEARCHSTRING&gt;&lt;BR /&gt;
  &lt;EARLIESTTIME&gt;-15m&lt;/EARLIESTTIME&gt;&lt;BR /&gt;
  &lt;LATESTTIME&gt;now&lt;/LATESTTIME&gt;&lt;BR /&gt;
  range&lt;BR /&gt;
  State&lt;BR /&gt;
  icon-only&lt;BR /&gt;
 &lt;/SINGLE&gt;&lt;BR /&gt;
&lt;/PANEL&gt;&lt;BR /&gt;
This will show a green "On", or a red value of "State" until the css is set, when you will get the icons.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sat, 13 Sep 2014 20:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124257#M33589</guid>
      <dc:creator>datasearchninja</dc:creator>
      <dc:date>2014-09-13T20:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124258#M33590</link>
      <description>&lt;P&gt;ok thnks.. but how do i use eval&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2014 05:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124258#M33590</guid>
      <dc:creator>kris99</dc:creator>
      <dc:date>2014-09-15T05:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124259#M33591</link>
      <description>&lt;P&gt;I've edited my original answer with some more detail.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2014 07:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124259#M33591</guid>
      <dc:creator>datasearchninja</dc:creator>
      <dc:date>2014-09-15T07:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124260#M33592</link>
      <description>&lt;P&gt;how can i rename the wording. . If state = On, Show as "Up" else show "Down"&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2014 06:25:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124260#M33592</guid>
      <dc:creator>kris99</dc:creator>
      <dc:date>2014-09-17T06:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124261#M33593</link>
      <description>&lt;P&gt;Just use eval to create the field you need, or to rename the State field:&lt;/P&gt;

&lt;P&gt;So change:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xx sourcetype="yyy" | stats first(State) as State | eval StateBool = if (State=="On", 0, 1) | rangemap field=StateBool low=0-0 severe=1-1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xx sourcetype="yyy" | stats first(State) as State | eval StateBool = if (State=="On", 0, 1) | eval State = if (State=="On", "Up", "Down") | rangemap field=StateBool low=0-0 severe=1-1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Sep 2014 07:33:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124261#M33593</guid>
      <dc:creator>datasearchninja</dc:creator>
      <dc:date>2014-09-17T07:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124262#M33594</link>
      <description>&lt;P&gt;Based on the above search, how do I join below two searches and return the following within same SingleValue&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;If "ConnectionStatus" is "On" and "Events" is "0" , display "No Errors" with low range&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If "ConnectionStatus" is "On" and "Events" is greater than "0"  , display "Warning" with elevated range&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If "ConnectionStatus" is NOT "On" and "Events" is greater than "0"  , display "Error" with severe range&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;index=xxx  sourcetype="ConnectionStatus" State!="On" |stats first(State) as State | stats count | appendpipe [ stats count | eval Status="Up" | where count==0 ] | eval Status=if(count==0,"Up","Down") | eval range = if(Status=="No Errors","low","severe")&lt;/P&gt;

&lt;P&gt;index=yyy sourcetype="Events"  Type!=Information  (EventCode&amp;gt;="3012" AND EventCode&amp;lt;="3054") | stats count | eval StateBool = if (count==0, 0, 1) | eval Status=if(count==0,"No Errors","Warning") | rangemap field=StateBool low=0-0 elevated=1-1 | table Status range&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2014 05:36:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124262#M33594</guid>
      <dc:creator>kris99</dc:creator>
      <dc:date>2014-09-29T05:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: range status</title>
      <link>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124263#M33595</link>
      <description>&lt;P&gt;tried using the same technique to join multiple searches but getting an error.&lt;/P&gt;

&lt;P&gt;What am i doing wrong ?&lt;/P&gt;

&lt;P&gt;index=xx sourcetype="ConnectionStatus" State!="On" | stats count(State) as down_count | appendcols [search index=yy sourcetype="Events"  Type!=Information  (EventCode&amp;gt;="3012" AND EventCode&amp;lt;="3054") |stats count | rename count as evt_count] | eval StateBool = if(down_count==0 AND evt_count==0, 0, down_count==0 AND evt_count &amp;gt;0, 1, down_count&amp;gt;0 AND evt_count&amp;gt;0, 2) | eval Status = if(down_count==0 AND evt_count==0,"Ok", down_count==0 AND evt_count&amp;gt;0,"Warning", down_count&amp;gt;0 AND evt_count&amp;gt;0,"Error")| rangemap field=StateBool low=0-0 elevated=1-1 severe=2-2 | table Status range&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:44:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/range-status/m-p/124263#M33595</guid>
      <dc:creator>kris99</dc:creator>
      <dc:date>2020-09-28T17:44:32Z</dc:date>
    </item>
  </channel>
</rss>

