<?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 set-up alert on splunk that notifies on occurrence of set of strings above threshold value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-alert-on-splunk-that-notifies-on-occurrence-of-set/m-p/96008#M24781</link>
    <description>&lt;P&gt;Its quite natural for any of us to look for occurrence of a set of strings. It will be necessary to send alert only  if it exceeds threshold limit.&lt;BR /&gt;
What is the best way to achieve it?&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2012 09:55:56 GMT</pubDate>
    <dc:creator>ma_anand1984</dc:creator>
    <dc:date>2012-10-19T09:55:56Z</dc:date>
    <item>
      <title>How to set-up alert on splunk that notifies on occurrence of set of strings above threshold value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-alert-on-splunk-that-notifies-on-occurrence-of-set/m-p/96008#M24781</link>
      <description>&lt;P&gt;Its quite natural for any of us to look for occurrence of a set of strings. It will be necessary to send alert only  if it exceeds threshold limit.&lt;BR /&gt;
What is the best way to achieve it?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 09:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-alert-on-splunk-that-notifies-on-occurrence-of-set/m-p/96008#M24781</guid>
      <dc:creator>ma_anand1984</dc:creator>
      <dc:date>2012-10-19T09:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to set-up alert on splunk that notifies on occurrence of set of strings above threshold value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-alert-on-splunk-that-notifies-on-occurrence-of-set/m-p/96009#M24782</link>
      <description>&lt;P&gt;This question is extension of the question asked here&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/61664/search-set-of-strings-from-lookup-and-list-count-of-occurance" target="_blank"&gt;http://splunk-base.splunk.com/answers/61664/search-set-of-strings-from-lookup-and-list-count-of-occurance&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Assumption&lt;/STRONG&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Lookup file should be in below format&lt;/LI&gt;
&lt;LI&gt;first column should have plain non special single valued search string &lt;/LI&gt;
&lt;LI&gt;second column should have above said search string followed by and underscore and threshold limit&lt;/LI&gt;
&lt;LI&gt;threshold limit should be in two digit (if three digit is need make it three but make a  change in query)&lt;/LI&gt;
&lt;LI&gt;| eval fooC = tonumber(substr(foo,&lt;STRONG&gt;-2&lt;/STRONG&gt;)) to | eval fooC = tonumber(substr(foo,&lt;STRONG&gt;-3&lt;/STRONG&gt;))&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;All other assumptions mentioned in the question in link above holds good&lt;/P&gt;

&lt;PRE&gt;
yourStringFieldName,yourStringFieldNameTwo
search_string_A,search_string_A_05
search_string_B,search_string_B_10
search_string_C,search_string_C_05
&lt;/PRE&gt;

&lt;P&gt;Actual command&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[| inputlookup your_lookup_here | rename yourStringFieldName as search | fields search | format] &lt;BR /&gt;
| rename _raw as rawText&lt;BR /&gt;
| eval foo=[| inputlookup your_lookup_here | stats values(yourStringFieldNameTwo) as query | eval query=mvjoin(query,",")&lt;BR /&gt;
| fields query &lt;BR /&gt;
| eval query="\"".query."\"" ] &lt;BR /&gt;
| eval foo=split(foo,",") &lt;BR /&gt;
| mvexpand foo &lt;BR /&gt;
| eval rawText=lower(rawText) &lt;BR /&gt;
| where like(rawText,"%"+lower(substr(foo,1,len(foo)-3))+"%")&lt;BR /&gt;
| eval fooC = tonumber(substr(foo,-2))&lt;BR /&gt;
| eval foo = substr(foo,1,len(foo)-3)&lt;BR /&gt;
| stats count by foo fooC&lt;BR /&gt;
| where count &amp;gt;= fooC&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-alert-on-splunk-that-notifies-on-occurrence-of-set/m-p/96009#M24782</guid>
      <dc:creator>ma_anand1984</dc:creator>
      <dc:date>2020-09-28T12:39:17Z</dc:date>
    </item>
  </channel>
</rss>

