<?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 Dynamic Alerting based on rules from excel file in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-Alerting-based-on-rules-from-excel-file/m-p/495320#M32440</link>
    <description>&lt;P&gt;I was given below excel of rules&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FT          OOS     ErrorCode   Priority      Min_req   Max_Req Min_Req_Fail    Max_Req_Fail    Failure%    watch   
ALCATEL_FT  ALCATEL   ALLERRORS     1       20          300         20              40          0       3                                   
ALCATEL_FT  ALCATEL   ALLERRORS     2       20          300         41              75          0       2                                   
ALCATEL_FT  ALCATEL   ALLERRORS     3       20          300         76               0          0       1                                   
ALCATEL_FT  ALCATEL   ALLERRORS     4       20          0            301               0            0       1                                   
ALCATEL_FT  ALCATEL   ALLERRORS     5       20          0            0               0          100     2                                   
GWR_FT      GWRNG_NY      ALLERRORS     1       20          300         20              60          0       3                                   
GWR_FT      GWRNG_NY      ALLERRORS     2       20          300         61              100         0       2                                   
GWR_FT      GWRNG_NY      ALLERRORS     3       20          300         101             0           0       1                                   
GWR_FT      GWRNG_NY      ALLERRORS     4       20          0           201             0           0       1                                   
GWR_FT      GWRNG_NY      ALLERRORS     5       20          0           0               0           90      2   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have the log file in splunk saved into index dte4fios and I have the fields FT,Error_Code &amp;amp; OSS which are same as above lookup file columns FT,ErrorCode &amp;amp; OSS.&lt;/P&gt;

&lt;P&gt;I was given below requirement to create a very dynamic alert by using the rules in the above lookup file.&lt;BR /&gt;
1. My Alert should run every 15 mins (lete us assume alert is running at 11AM)and check for if there is any any FT &amp;amp; Error Code combination which has satisfied above rules and if yes then send an alert with output of some other query.&lt;BR /&gt;
2. Let me explain the understanding of rules in above lookup file for one of the FT ALCATEL_FT in this case. Rules should be validated in order of Prioirty 5 to Proirity 1&lt;BR /&gt;
    Prioirty 5 Rule: &lt;BR /&gt;
    Min_req - If in last 15 mins if this FT has got min hits of 20&lt;BR /&gt;
    Max_Req -  Max can be anything (0 to denote as max can be anything)&lt;BR /&gt;
    Failure% - If Failure% is 100 &lt;BR /&gt;
    watch - 2 means that I need to check whether in my previous 15min interval (i.e. 10:30-10:45) also this FT is satisfying the Rule 5 or not. If yes then only send the alert otherwise not.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Prioirty 4 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
    Max_Req -  Max can be anything (0 to denote as max can be anything)
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=301
watch - 1 means that I need not check my prior 15min interval and just send the alert

Prioirty 3 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
Max_Req -  If in last 15 mins FT has got max hits of &amp;lt;=300
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=76
watch - 1 means that I need not check my prior 15min interval and just send the alert

Prioirty 2 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
    Max_Req -  If in last 15 mins FT has got max hits of &amp;lt;=300
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=41
Min_Req_Fail - If Min_Req_Fail is &amp;lt;=75
watch - 2 means that I need to check whether in my previous 15min interval (i.e. 10:30-10:45) also this FT is satisfying the Rule 2 or not. If yes then only send the alert otherwise not.

Prioirty 1 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
    Max_Req -  If in last 15 mins FT has got max hits of &amp;lt;=300
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=20
Min_Req_Fail - If Min_Req_Fail is &amp;lt;=40
watch - 3 means that I need to check whether in my previous 2 15min interval (i.e. 10:30-10:45, 10:15-10:30) also this FT is satisfying the Rule 1 or not. If yes then only send the alert otherwise not.

This is how I need to comapre my log with the rules in the lookup table and generate an alert. Above lookup table is a sample one but it has more rows with diff FT, Error_Code &amp;amp; rules.
I am pretty new to splunk and will be a real help if someone can guide me in writing query to achieve this for 1 FT so that I can simulate for entire lookup table.

index=dte_fios sourcetype=dte2_Fios FT=*FT earliest=04/20/2020:11:00:00 latest=04/20/2020:13:00:00
| stats count as Total, count(eval(Error_Code!="0000")) AS Failure by FT
| eval Failurepercent=round(Failure/Total*100)
| table FT, Total,Failure,Failurepercent

I need help with how to get the rows for every 15min interval for each FT &amp;amp; ErroCode and then verify the rules
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Sep 2020 05:23:12 GMT</pubDate>
    <dc:creator>poddraj</dc:creator>
    <dc:date>2020-09-30T05:23:12Z</dc:date>
    <item>
      <title>Dynamic Alerting based on rules from excel file</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-Alerting-based-on-rules-from-excel-file/m-p/495320#M32440</link>
      <description>&lt;P&gt;I was given below excel of rules&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FT          OOS     ErrorCode   Priority      Min_req   Max_Req Min_Req_Fail    Max_Req_Fail    Failure%    watch   
ALCATEL_FT  ALCATEL   ALLERRORS     1       20          300         20              40          0       3                                   
ALCATEL_FT  ALCATEL   ALLERRORS     2       20          300         41              75          0       2                                   
ALCATEL_FT  ALCATEL   ALLERRORS     3       20          300         76               0          0       1                                   
ALCATEL_FT  ALCATEL   ALLERRORS     4       20          0            301               0            0       1                                   
ALCATEL_FT  ALCATEL   ALLERRORS     5       20          0            0               0          100     2                                   
GWR_FT      GWRNG_NY      ALLERRORS     1       20          300         20              60          0       3                                   
GWR_FT      GWRNG_NY      ALLERRORS     2       20          300         61              100         0       2                                   
GWR_FT      GWRNG_NY      ALLERRORS     3       20          300         101             0           0       1                                   
GWR_FT      GWRNG_NY      ALLERRORS     4       20          0           201             0           0       1                                   
GWR_FT      GWRNG_NY      ALLERRORS     5       20          0           0               0           90      2   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have the log file in splunk saved into index dte4fios and I have the fields FT,Error_Code &amp;amp; OSS which are same as above lookup file columns FT,ErrorCode &amp;amp; OSS.&lt;/P&gt;

&lt;P&gt;I was given below requirement to create a very dynamic alert by using the rules in the above lookup file.&lt;BR /&gt;
1. My Alert should run every 15 mins (lete us assume alert is running at 11AM)and check for if there is any any FT &amp;amp; Error Code combination which has satisfied above rules and if yes then send an alert with output of some other query.&lt;BR /&gt;
2. Let me explain the understanding of rules in above lookup file for one of the FT ALCATEL_FT in this case. Rules should be validated in order of Prioirty 5 to Proirity 1&lt;BR /&gt;
    Prioirty 5 Rule: &lt;BR /&gt;
    Min_req - If in last 15 mins if this FT has got min hits of 20&lt;BR /&gt;
    Max_Req -  Max can be anything (0 to denote as max can be anything)&lt;BR /&gt;
    Failure% - If Failure% is 100 &lt;BR /&gt;
    watch - 2 means that I need to check whether in my previous 15min interval (i.e. 10:30-10:45) also this FT is satisfying the Rule 5 or not. If yes then only send the alert otherwise not.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Prioirty 4 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
    Max_Req -  Max can be anything (0 to denote as max can be anything)
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=301
watch - 1 means that I need not check my prior 15min interval and just send the alert

Prioirty 3 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
Max_Req -  If in last 15 mins FT has got max hits of &amp;lt;=300
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=76
watch - 1 means that I need not check my prior 15min interval and just send the alert

Prioirty 2 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
    Max_Req -  If in last 15 mins FT has got max hits of &amp;lt;=300
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=41
Min_Req_Fail - If Min_Req_Fail is &amp;lt;=75
watch - 2 means that I need to check whether in my previous 15min interval (i.e. 10:30-10:45) also this FT is satisfying the Rule 2 or not. If yes then only send the alert otherwise not.

Prioirty 1 Rule: 
Min_req - If in last 15 mins FT has got min hits of 20
    Max_Req -  If in last 15 mins FT has got max hits of &amp;lt;=300
Min_Req_Fail - If Min_Req_Fail is &amp;gt;=20
Min_Req_Fail - If Min_Req_Fail is &amp;lt;=40
watch - 3 means that I need to check whether in my previous 2 15min interval (i.e. 10:30-10:45, 10:15-10:30) also this FT is satisfying the Rule 1 or not. If yes then only send the alert otherwise not.

This is how I need to comapre my log with the rules in the lookup table and generate an alert. Above lookup table is a sample one but it has more rows with diff FT, Error_Code &amp;amp; rules.
I am pretty new to splunk and will be a real help if someone can guide me in writing query to achieve this for 1 FT so that I can simulate for entire lookup table.

index=dte_fios sourcetype=dte2_Fios FT=*FT earliest=04/20/2020:11:00:00 latest=04/20/2020:13:00:00
| stats count as Total, count(eval(Error_Code!="0000")) AS Failure by FT
| eval Failurepercent=round(Failure/Total*100)
| table FT, Total,Failure,Failurepercent

I need help with how to get the rows for every 15min interval for each FT &amp;amp; ErroCode and then verify the rules
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:23:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-Alerting-based-on-rules-from-excel-file/m-p/495320#M32440</guid>
      <dc:creator>poddraj</dc:creator>
      <dc:date>2020-09-30T05:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Alerting based on rules from excel file</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-Alerting-based-on-rules-from-excel-file/m-p/495321#M32441</link>
      <description>&lt;P&gt;Can someone tell me if this use case can be implemented using splunk?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 07:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-Alerting-based-on-rules-from-excel-file/m-p/495321#M32441</guid>
      <dc:creator>poddraj</dc:creator>
      <dc:date>2020-05-12T07:07:12Z</dc:date>
    </item>
  </channel>
</rss>

