<?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: How to calculate the percentage and create an alert condition that triggers for a drop of 5%. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489752#M136795</link>
    <description>&lt;P&gt;Great it works, Thank you. &lt;/P&gt;

&lt;P&gt;How can i now show it to display the result with specific LED (1--20) on each TV (1...24) deployed at multiple hosts .&lt;/P&gt;

&lt;P&gt;Basically i need an alert messge with Host - Led no - Tv no. so its easy to identify if any location has a issue with LED dropping by 5% and for the TV number .&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2020 12:11:31 GMT</pubDate>
    <dc:creator>pkumar2</dc:creator>
    <dc:date>2020-01-22T12:11:31Z</dc:date>
    <item>
      <title>How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489749#M136792</link>
      <description>&lt;P&gt;My Search has the below format data.&lt;/P&gt;

&lt;P&gt;A single host has multiple parameters consists of LED 1..to.20 for each TV and there are 24 TV's , The LED power paramerter has value say Max(val) 34.0 which is related to PA (power Amplitude) of Low/High, we only want search for PA = Low&lt;/P&gt;

&lt;P&gt;Query : source="c:\program files (x86)\xxxx" "PLogger" TV earliest=-2d@d latest=now  PA = Low | stats  max(VAL) by host, TV, LED, PA , _time  | fields  "host" "LED","PA", "TV", "max(VAL)" | &lt;/P&gt;

&lt;P&gt;Result :&lt;BR /&gt;
host                      LED   PA           TV           Max (Val)     _Time&lt;BR /&gt;
03192610158 0   Low     A1          48.863      2019-12-19 22:00:08.177&lt;BR /&gt;
03192610158 0   Low         A1           48.61      2019-12-20 22:00:08.140&lt;BR /&gt;
031.................        1      Low        A1            44.23         2019-12-19 22:00:08.177&lt;BR /&gt;
031.................        1      Low        A1            45.23         2019-12-20 22:00:08.177&lt;BR /&gt;
|||||&lt;BR /&gt;
|||||&lt;BR /&gt;
031.................        19      Low        A1          49.23         2019-12-19 22:00:08.177&lt;BR /&gt;
031.................        19      Low        A1          50.23         2019-12-20 22:00:08.177&lt;BR /&gt;
|||||&lt;BR /&gt;
|||||&lt;BR /&gt;
031.................        1      Low        A2          52.23         2019-12-19 22:00:08.177&lt;BR /&gt;
031.................        1     Low        A2          53.73         2019-12-20 22:00:08.177&lt;BR /&gt;
AND Continues for the same host and for each TV and its LED's of 20.&lt;/P&gt;

&lt;P&gt;Now i need to calculate the percentage difference of LED 1 2..till..19  for each TV ( A1 ---A24) and raise and Alert for any LED's if they drop by 5%.&lt;/P&gt;

&lt;P&gt;I am stuck in how to get the alert correctly. Please help me in getting correct answer to get my alert condition right.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 18:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489749#M136792</guid>
      <dc:creator>pkumar2</dc:creator>
      <dc:date>2020-01-21T18:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489750#M136793</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You could use the delta command to achieve to calculate the difference.&lt;/P&gt;

&lt;P&gt;Please use the below query and let us know whether this helped.&lt;BR /&gt;
The difference between the adjacent records is evaluated using the delta command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    |source="c:\\program files (x86)\\xxxx" "PLogger" TV earliest=-2d@d latest=now PA = Low 
    |stats max(VAL) by host, TV, LED, PA , _time 
    |fields "host" "LED","PA", "TV", "max(VAL)" 
    |rename max(VAL) as max_value
    |delta max_value as power_delta p=1
    |eval delta_perc=round(power_delta*100/(max_value-power_delta),2)
    |where delta_perc&amp;gt;5
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jan 2020 19:34:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489750#M136793</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2020-01-21T19:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489751#M136794</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;source="c:\\program files (x86)\\xxxx" "PLogger" TV earliest=-2d@d latest=now PA = Low 
| stats max(VAL) as max_val by host, TV, LED, PA , _time 
| fields host, TV, LED, PA , max_val, _time 
| streamstats current=f  values(max_val) as prev_val by LED TV
| eval perc_diff=if(isnotnull(prev_val),abs((max_val - prev_val)/((max_val + prev_val)/2)*100),NULL)
| where perc_diff &amp;gt; 5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cf. &lt;A href="https://www.calculatorsoup.com/calculators/algebra/percent-difference-calculator.php"&gt;percentage difference calculator&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hi, @pkumar2 &lt;BR /&gt;
The formula was borrowed from the link. How about this?&lt;/P&gt;

&lt;P&gt;Hi, @dindu &lt;BR /&gt;
&lt;CODE&gt;delta&lt;/CODE&gt; is useful. but in your query,&lt;BR /&gt;
 When the type of LED changes, it calculates the value immediately before another LED.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 21:01:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489751#M136794</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-21T21:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489752#M136795</link>
      <description>&lt;P&gt;Great it works, Thank you. &lt;/P&gt;

&lt;P&gt;How can i now show it to display the result with specific LED (1--20) on each TV (1...24) deployed at multiple hosts .&lt;/P&gt;

&lt;P&gt;Basically i need an alert messge with Host - Led no - Tv no. so its easy to identify if any location has a issue with LED dropping by 5% and for the TV number .&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 12:11:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489752#M136795</guid>
      <dc:creator>pkumar2</dc:creator>
      <dc:date>2020-01-22T12:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489753#M136796</link>
      <description>&lt;P&gt;Thank you, the query works partially wherin for the next set of LED the values are not listed.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 12:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489753#M136796</guid>
      <dc:creator>pkumar2</dc:creator>
      <dc:date>2020-01-22T12:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489754#M136797</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; ....
| where perc_diff &amp;gt; 5
| eval equipments=TV.":".LED
| stats values(equipments) as equipments by host
| eval equipments=mvjoin(equipments,",")
| table host equipments
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try &lt;CODE&gt;$result.host$&lt;/CODE&gt;  and &lt;CODE&gt;$result.equipments$&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 21:11:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489754#M136797</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-22T21:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489755#M136798</link>
      <description>&lt;P&gt;Thank you, Works perfectly. &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 12:00:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489755#M136798</guid>
      <dc:creator>pkumar2</dc:creator>
      <dc:date>2020-01-23T12:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489756#M136799</link>
      <description>&lt;P&gt;you're welcome. happy splunking.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 12:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489756#M136799</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T12:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489757#M136800</link>
      <description>&lt;P&gt;Hi, I am relooking at this answer as we decide to go live. What i see is that for the max and Min value is not correctly applied. &lt;/P&gt;

&lt;P&gt;-- Each TV has 20 LED , So Max and Min value for the duration of -7d@d is not giving correct value. The calculation takes the latest day value as min and not sorting for max and min to give the correct delta.&lt;/P&gt;

&lt;P&gt;What could be the change in query to reflect the correct output.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 16:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489757#M136800</guid>
      <dc:creator>pkumar2</dc:creator>
      <dc:date>2020-05-13T16:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the percentage and create an alert condition that triggers for a drop of 5%.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489758#M136801</link>
      <description>&lt;P&gt;@to4kawa  Any suggestion to correct the query. I am stuck on this.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 17:12:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-percentage-and-create-an-alert-condition/m-p/489758#M136801</guid>
      <dc:creator>pkumar2</dc:creator>
      <dc:date>2020-05-15T17:12:36Z</dc:date>
    </item>
  </channel>
</rss>

