<?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: adding percentage of SLA breach in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572949#M199691</link>
    <description>&lt;LI-CODE lang="markup"&gt;| eval ttt=(review_time - '_time')
| eval breach=if(ttt&amp;gt;60*60*2,1,0)
| stats count, sum(breach) as breach by rule_name
| eval OK=count-breach
| table rule_name OK breach&lt;/LI-CODE&gt;&lt;P&gt;Then visualise as a stacked column chart?&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 12:59:09 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-10-29T12:59:09Z</dc:date>
    <item>
      <title>adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572942#M199687</link>
      <description>&lt;P&gt;I'd like to add a percentage into the following panel:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="avoelk_0-1635509142530.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16664i81EE65E1818D550B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="avoelk_0-1635509142530.png" alt="avoelk_0-1635509142530.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've added severity since I just want to see it for critical and high severity. now I'd like to define an sla value of , let's say 2 hours, and then want a percentage of each rules percentage of it's count breached.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so in other words:&amp;nbsp; in this statistic I want to have an additional field that tells me the percentage of how many of the counted events for those rules have a longer max time to triage than 2h.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rule 1 count 20 (10 breached over 2h sla) -&amp;gt; a field that tells me 50%&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to find a good way to get a percentage in. here is the whole SPL (from ES mostly):&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=true allow_old_summaries=false earliest(_time) as _time FROM datamodel=Incident_Management BY source, "Notable_Events_Meta.rule_id"
| rename "Notable_Events_Meta.*" as "*"
| lookup update=true correlationsearches_lookup _key as source OUTPUTNEW annotations, security_domain, severity, rule_name, description as savedsearch_description, rule_title, rule_description, drilldown_name, drilldown_search, drilldown_earliest_offset, drilldown_latest_offset, default_status, default_owner, next_steps, investigation_profiles, extract_artifacts, recommended_actions
| eval rule_name=if(isnull(rule_name),source,rule_name),
rule_title=if(isnull(rule_title),rule_name,rule_title),
drilldown_earliest=case(isint(drilldown_earliest_offset),('_time' - drilldown_earliest_offset),(drilldown_earliest_offset == "$info_min_time$"),info_min_time,true(),null()),
drilldown_latest=case(isint(drilldown_latest_offset),('_time' + drilldown_latest_offset),(drilldown_latest_offset == "$info_max_time$"),info_max_time,true(),null()),
security_domain=if(isnull(security_domain),"threat",lower(security_domain)),
rule_description=case(isnotnull(rule_description),rule_description,isnotnull(savedsearch_description),savedsearch_description,true(),"unknown")
| eval governance_lookup_type="default"
| lookup update=true governance_lookup savedsearch as source, lookup_type as governance_lookup_type OUTPUT governance, control
| eval governance_lookup_type="tag"
| lookup update=true governance_lookup savedsearch as source, tag, lookup_type as governance_lookup_type OUTPUT governance as governance_tag, control as control_tag
| eval governance=mvappend(governance,NULL,governance_tag), control=mvappend(control,NULL,control_tag)
| fields - governance_lookup_type, governance_tag, control_tag
| join rule_id
[| inputlookup incident_review_lookup
| eval _time=time
| stats earliest(_time) as review_time by rule_id]
| eval ttt=(review_time - '_time')
| stats count,values(severity) as severity avg(ttt) as avg_ttt,min(ttt) as min_ttt,max(ttt) as max_ttt by rule_name
| search severity=high OR severity=critical
| `uptime2string(avg_ttt, avg_ttt)` 
| `uptime2string(max_ttt, max_ttt)`
| `uptime2string(min_ttt, min_ttt)`
| sort severity -avg_ttt
| rename "*_ttt*" as "*(time_to_triage)*"
| fields - "*_dec"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 12:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572942#M199687</guid>
      <dc:creator>avoelk</dc:creator>
      <dc:date>2021-10-29T12:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572943#M199688</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ttt=(review_time - '_time')
| eval breach=if(ttt&amp;gt;60*60*2,1,0)
| stats count,values(severity) as severity avg(ttt) as avg_ttt,min(ttt) as min_ttt,max(ttt) as max_ttt sum(breach) as breach by rule_name
| eval percent=100*breach/count&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Oct 2021 12:21:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572943#M199688</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-29T12:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572945#M199690</link>
      <description>&lt;P&gt;thanks so much for that, it worked.&amp;nbsp; when I now add a percent of not breached field, what would I need to do to highlight this one for example as red when it goes below 95%?&lt;BR /&gt;&lt;BR /&gt;edited: change of question&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 13:21:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572945#M199690</guid>
      <dc:creator>avoelk</dc:creator>
      <dc:date>2021-10-29T13:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572949#M199691</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval ttt=(review_time - '_time')
| eval breach=if(ttt&amp;gt;60*60*2,1,0)
| stats count, sum(breach) as breach by rule_name
| eval OK=count-breach
| table rule_name OK breach&lt;/LI-CODE&gt;&lt;P&gt;Then visualise as a stacked column chart?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 12:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572949#M199691</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-29T12:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572956#M199694</link>
      <description>&lt;P&gt;hello! I thought about it, a visual isn't necessary &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; so additionally I try to do the following:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval OK=100-percent
| eval slastatus=case(OK&amp;lt;95,"NOT OK",OK==95,"IN NEED OF ADJUSTMENT",OK&amp;gt;95,"OK",1=1,0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is how it looks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="avoelk_0-1635513777558.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16667i532F0BC76340AE4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="avoelk_0-1635513777558.png" alt="avoelk_0-1635513777558.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;what I further try to do is&amp;nbsp;&lt;BR /&gt;a) highlight the percentage in "OK" where it falls bellow 95&lt;BR /&gt;b) maybe a drilldown in which I click on the rule and it shows me the underlying events that breached&lt;/P&gt;&lt;P&gt;is it possible to change the sla based on the severity?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 13:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572956#M199694</guid>
      <dc:creator>avoelk</dc:creator>
      <dc:date>2021-10-29T13:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572961#M199698</link>
      <description>&lt;P&gt;I changed the SLA based on severity like that:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval breaches=case(ttt&amp;gt;7200 AND severity=="critical",1,ttt&amp;gt;14400 AND severity=="high",1,ttt&amp;gt;32400 AND severity=="medium",1,ttt&amp;gt;86400 AND severity=="informational",1,1==1,0)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I have different slas for different severity levels. now, if the sla was breached more than 5% of total events (bellow 95% ok) then it should be highlighted red.&lt;/P&gt;&lt;P&gt;afterwards I'd generate another panel in which all breached events are shown. might be easier than a drilldown &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; what do you think?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 13:43:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572961#M199698</guid>
      <dc:creator>avoelk</dc:creator>
      <dc:date>2021-10-29T13:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572962#M199699</link>
      <description>&lt;P&gt;Highlight based on value is possibly - there are numerous answers about doing this&lt;/P&gt;&lt;P&gt;Drilldown is possible - see splunk documentation&lt;/P&gt;&lt;P&gt;For sla based on severity, you could do a further lookup to get another field with the corresponding sla value against which to compare (that's the approach I use).&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 13:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572962#M199699</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-29T13:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572963#M199700</link>
      <description>&lt;P&gt;Or do both - i.e. have a panel with all breach events, but also have a drilldown to allow the user the hone in on a subset of the events (by rule name?)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 13:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/572963#M199700</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-29T13:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/573274#M199794</link>
      <description>&lt;P&gt;So I highlighted everything accordingly too but it doesn't seem to work to show the underlying events that are causing those breaches &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the spl is in tstats (mostly copied from ES) and within ES upon clicking a rule it forwards me to a different dashboard in incident review and shows me all the single events/incidents. I can't seem to mimik this behavior with my own query/dashboard. I guess partially because I don't use rules but only want to see those events that caused the breach.&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have any input on this? I'm not sure how I can use my own field ES doesn't know about to show me the underlying incidents that caused those breaches.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 08:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/573274#M199794</guid>
      <dc:creator>avoelk</dc:creator>
      <dc:date>2021-11-02T08:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: adding percentage of SLA breach</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/573299#M199800</link>
      <description>&lt;P&gt;Perhaps you could look at it the other way around - construct a dashboard/panel which has the results you want and then look at how the parameters to the search used by this dashboard can be set as tokens by the drilldown from the first panel.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 11:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-percentage-of-SLA-breach/m-p/573299#M199800</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-02T11:48:21Z</dc:date>
    </item>
  </channel>
</rss>

