<?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: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING in Splunk ITSI</title>
    <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699370#M2934</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260418"&gt;@dhiraj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to change only the time period (7 minutes), then the search shoudl be correct:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index ("Error occurred during message exchange" OR REQ="INI") earliest=-420s
| eval type=if(REQ="INI","INI","Message")
| stats dc(type) AS type_count values(type) As type
| where type_count=1 AND type="Message"&lt;/LI-CODE&gt;&lt;P&gt;using this search you select only events with your two conditions and using the eval and the stats you identify the presence of one or both the conditions.&lt;/P&gt;&lt;P&gt;In your use case you want to fire the alert if there's the error message but there isn't the REQ=INI condition, the other conditions are excluded.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2024 08:22:06 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-09-18T08:22:06Z</dc:date>
    <item>
      <title>CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699364#M2931</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-18 124304.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32678i18EDDE5D52222D55/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-18 124304.png" alt="Screenshot 2024-09-18 124304.png" /&gt;&lt;/span&gt;Please help me with SPL for WHENEVER THERE IS ERROR OCCURED DURING MESSAGE EXCHANGE KEYWORD OCCURS AND REQ=INI didn't occur within few minutes raise and alert.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 07:19:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699364#M2931</guid>
      <dc:creator>dhiraj</dc:creator>
      <dc:date>2024-09-18T07:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699365#M2932</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260418"&gt;@dhiraj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I suppose that you already extracted the REQ field, so you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index ("Error occurred during message exchange" OR REQ="INI") earliest=-3600s
| eval type=if(REQ="INI","INI","Message")
| stats dc(type) AS type_count values(type) As type
| where type_count=1 AND type="Message"&lt;/LI-CODE&gt;&lt;P&gt;You can define the time period for the search (e.g. last hour).&lt;/P&gt;&lt;P&gt;If you eventually have more servers, you can group results by host in the stats command.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 07:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699365#M2932</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-18T07:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699369#M2933</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It's not working, we are monitoring log and&amp;nbsp;&lt;SPAN&gt;Whenever the line Error occurred during message exchange and if REQ=&lt;/SPAN&gt;&lt;SPAN class=""&gt;INI&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;line didn’t occur in last 7 minutes , it should trigger an alert.&lt;BR /&gt;With above search I am getting type_count=1 in both the condition, if&amp;nbsp;“REQ=&lt;SPAN class=""&gt;INI&lt;/SPAN&gt;” is present and if not present.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 07:58:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699369#M2933</guid>
      <dc:creator>dhiraj</dc:creator>
      <dc:date>2024-09-18T07:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699370#M2934</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260418"&gt;@dhiraj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to change only the time period (7 minutes), then the search shoudl be correct:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index ("Error occurred during message exchange" OR REQ="INI") earliest=-420s
| eval type=if(REQ="INI","INI","Message")
| stats dc(type) AS type_count values(type) As type
| where type_count=1 AND type="Message"&lt;/LI-CODE&gt;&lt;P&gt;using this search you select only events with your two conditions and using the eval and the stats you identify the presence of one or both the conditions.&lt;/P&gt;&lt;P&gt;In your use case you want to fire the alert if there's the error message but there isn't the REQ=INI condition, the other conditions are excluded.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 08:22:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699370#M2934</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-18T08:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699374#M2935</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am checking for whole day for testing and it's giving me count as 1 and only type is message.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhiraj_0-1726648469894.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32680i2D16068768AA865B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhiraj_0-1726648469894.png" alt="dhiraj_0-1726648469894.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But in actual we have&amp;nbsp; both keyword in data, which means no alert required.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhiraj_1-1726648695916.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32681iEB9B84FCF1467C71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhiraj_1-1726648695916.png" alt="dhiraj_1-1726648695916.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 08:38:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699374#M2935</guid>
      <dc:creator>dhiraj</dc:creator>
      <dc:date>2024-09-18T08:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699375#M2936</link>
      <description>&lt;P&gt;Try This:&lt;/P&gt;&lt;PRE&gt;index="yourindex"&amp;nbsp; latest=-7m | transaction startswith="Error occurred during message exchange" &lt;BR /&gt;endswith="REQ\=INI" keepevicted=true | search closed_txn=0&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2024 08:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699375#M2936</guid>
      <dc:creator>Jawahir</dc:creator>
      <dc:date>2024-09-18T08:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699376#M2937</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260418"&gt;@dhiraj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;are you sure that the REQ field is already extracted?&lt;/P&gt;&lt;P&gt;otherwise you ha to search a different condition:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index ("Error occurred during message exchange" OR "REQ=INI") earliest=-420s
| eval type=if(searchmatch("REQ=INI"),"INI","Message")
| stats dc(type) AS type_count values(type) As type
| where type_count=1 AND type="Message"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 08:59:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699376#M2937</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-18T08:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699377#M2938</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Stil I am getting same output with both situation. If I have only&amp;nbsp;"Error occurred during message exchange" then also getting type_count=1 and type =message and when I have both keyword&amp;nbsp;"Error occurred during message exchange" and "REQ=INI" than also type_count=1 and type =message&lt;BR /&gt;&lt;BR /&gt;FYI, I have not extracted any data, just monitoring data logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 09:14:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699377#M2938</guid>
      <dc:creator>dhiraj</dc:creator>
      <dc:date>2024-09-18T09:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699378#M2939</link>
      <description>&lt;P&gt;Can you please elaborated a bit.&lt;BR /&gt;&lt;BR /&gt;Its not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 09:16:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699378#M2939</guid>
      <dc:creator>dhiraj</dc:creator>
      <dc:date>2024-09-18T09:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699382#M2940</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/260418"&gt;@dhiraj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;P&gt;if you have both the events (message and REQ=INI), running the first two items of my search, you should have two types of events (check this in the interesting fields).&lt;/P&gt;&lt;P&gt;So the following stats command, should give you type_count=2 (if both present) and type_count=1 if there's only one.&lt;/P&gt;&lt;P&gt;If you have both the strings to search ("Error occurred during message exchange" and "REQ=INI") in two different events (as in your screenshots), you should have both the types; if not, check the strings to search and the eval condition.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 09:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699382#M2940</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-18T09:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699389#M2941</link>
      <description>&lt;P&gt;Transaction command will Group events based on the event content..&amp;nbsp; and will generate some extra fields like "closed_txn, eventcount, etc."&lt;/P&gt;&lt;P&gt;In this case we have selected the starting event with content "Error occurred during message exchange"&amp;nbsp; and ending event with content "REQ\=INI".&amp;nbsp; If both the events are present then the generated field "closed_txn=1" will set, else&amp;nbsp;closed_txn=0 will set.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jawahir007_0-1726655290701.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32682i88CF8B8523444124/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jawahir007_0-1726655290701.png" alt="jawahir007_0-1726655290701.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding below condition only will show the events which doesn't have a pair (REQ=INI) event. In the above screenshot you can see the second event is actually a group of 2 events (closed_txn=1) and the first event is standing alone (closed_txn=0).&lt;/P&gt;&lt;P&gt;Adding the below line to the search will only keep the event, for that&amp;nbsp;REQ=INI not yet received in last 7 min (Please note: 'latest =-7m' added as early filter)&lt;/P&gt;&lt;PRE&gt;| search closed_txn=0&lt;/PRE&gt;&lt;P&gt;The result will look like below, for that you can create an alert as you wish&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jawahir007_1-1726656046930.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32683i428B101E1A830D6F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jawahir007_1-1726656046930.png" alt="jawahir007_1-1726656046930.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is what you are looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 10:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699389#M2941</guid>
      <dc:creator>Jawahir</dc:creator>
      <dc:date>2024-09-18T10:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE ALERT IF ANY OF THE TWO KEYWORD MISSING</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699393#M2942</link>
      <description>&lt;P&gt;Splunk doesn't look "backwards" so you have to think backwards &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So as Splunk by default returns events in reverse chronological order, you have to&lt;/P&gt;&lt;PRE&gt;| reverse&lt;/PRE&gt;&lt;P&gt;them to get them in straight chronological order.&lt;/P&gt;&lt;P&gt;2. Assuming that you already have the REQ field extracted, keep track of its values for a 7-minute long window&lt;/P&gt;&lt;PRE&gt;| streamstats time_window=7m values(REQ) AS reqvals&lt;/PRE&gt;&lt;P&gt;3. Now you can find those events matching your searchnstring and not having the value of REQ copied over from earlier events&lt;/P&gt;&lt;PRE&gt;| search "Error occurred during message exchange" AND NOT reqvals="INI"&lt;/PRE&gt;&lt;P&gt;Two caveats&lt;/P&gt;&lt;P&gt;1. The search might be slow. Depending on your actual data you might make it faster by searching only for&lt;/P&gt;&lt;PRE&gt;"Error occurred during message exchange" OR REQ&lt;/PRE&gt;&lt;P&gt;2. Remember that a!=b is &lt;STRONG&gt;not&lt;/STRONG&gt; the same as NOT a=b. Especially when dealing with multivalued fields.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 11:54:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/CREATE-ALERT-IF-ANY-OF-THE-TWO-KEYWORD-MISSING/m-p/699393#M2942</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-09-18T11:54:23Z</dc:date>
    </item>
  </channel>
</rss>

