<?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 to make alert which will trigger when certain log occured 5 times in 15 min? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535160#M151260</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;please help. I have log (example) :&lt;/P&gt;&lt;P&gt;[&lt;SPAN class="t"&gt;Information&lt;/SPAN&gt;] &lt;SPAN class="t"&gt;Downtime&lt;/SPAN&gt; &lt;SPAN class="t"&gt;start:08/01/2021&lt;/SPAN&gt; &lt;SPAN class="t"&gt;04:39:56.997&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;aaxService:NotAvailable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;and i would like to send email triggered by alert when this log will occur 5 times per host for 15 min?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;Thank you very much&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2021 08:57:37 GMT</pubDate>
    <dc:creator>ivana27</dc:creator>
    <dc:date>2021-01-08T08:57:37Z</dc:date>
    <item>
      <title>How to make alert which will trigger when certain log occured 5 times in 15 min?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535160#M151260</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;please help. I have log (example) :&lt;/P&gt;&lt;P&gt;[&lt;SPAN class="t"&gt;Information&lt;/SPAN&gt;] &lt;SPAN class="t"&gt;Downtime&lt;/SPAN&gt; &lt;SPAN class="t"&gt;start:08/01/2021&lt;/SPAN&gt; &lt;SPAN class="t"&gt;04:39:56.997&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;aaxService:NotAvailable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;and i would like to send email triggered by alert when this log will occur 5 times per host for 15 min?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;Thank you very much&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 08:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535160#M151260</guid>
      <dc:creator>ivana27</dc:creator>
      <dc:date>2021-01-08T08:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to make alert which will trigger when certain log occured 5 times in 15 min?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535161#M151261</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230051"&gt;@ivana27&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You have to schedule an alert every 15 minutes, running a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index "aaxService:NotAvailable" earliest=-15m@m latest=now
| stats count
| where count&amp;gt;5&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 09:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535161#M151261</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-01-08T09:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to make alert which will trigger when certain log occured 5 times in 15 min?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535176#M151268</link>
      <description>&lt;P&gt;Grazie Giuseppe.&lt;/P&gt;&lt;P&gt;Unfornatunately doesnt work proper, its not grouping them. This is my query&lt;/P&gt;&lt;P&gt;index=pkg_prespvm "aaxService:NotAvailable" sourcetype = sigma host IN (*)&lt;BR /&gt;| dedup _raw&lt;BR /&gt;| eval StartTime=strftime(_time, "%d/%m/%Y %H:%M:%S")&lt;BR /&gt;| stats count as "NumberErrors" by host,StartTime&lt;BR /&gt;| where count&amp;gt;=2&lt;/P&gt;&lt;P&gt;And result is null for the last 1 hour time range which is wrong because when i change query into this&lt;/P&gt;&lt;P&gt;index=pkg_prespvm "aaxService:NotAvailable" sourcetype = sigma host IN (*)&lt;BR /&gt;| dedup _raw&lt;BR /&gt;| eval StartTime=strftime(_time, "%d/%m/%Y %H:%M:%S")&lt;BR /&gt;| stats count as "NumberErrors" by host,StartTime&lt;/P&gt;&lt;P&gt;I see that i have 2 logs per host for last hour&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ivana27_0-1610104271542.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12484iB9540BAFC41FFB2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ivana27_0-1610104271542.png" alt="ivana27_0-1610104271542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 11:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535176#M151268</guid>
      <dc:creator>ivana27</dc:creator>
      <dc:date>2021-01-08T11:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to make alert which will trigger when certain log occured 5 times in 15 min?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535255#M151279</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230051"&gt;@ivana27&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at first you don't need the condition "&lt;SPAN&gt;host IN (*)" because is unuseful: you always have a value for host in your events.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then, why do you dedup for "_raw", have you some duplicated event?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;At least, if you use the stats command by StartTime after dedup you'll always have only one event because it's difficoult to have in the same host more than 2 events with the same timestamp!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So if you need to have an alert when you have more than 2 events in 15 minutes period, you have to group events by time; you can do this in three ways:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;using the bin (with span=15m) command before stats command;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;using the timechart command with span=15m instead of stats and bin,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;not setting the span period and define it in the alert (as I hinted in my answer).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;For an alert the third solution is the easiest.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For a dashboard panel you can use the first or the second, the second is easier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 08:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-alert-which-will-trigger-when-certain-log-occured-5/m-p/535255#M151279</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-01-09T08:45:10Z</dc:date>
    </item>
  </channel>
</rss>

