<?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: Split alerts by error type in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/648031#M908</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251345"&gt;@YatMan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could add to the stats command, using the values option, the fields you need.&lt;/P&gt;&lt;P&gt;To see the row events is just a little complicated: you should use table comman instead stats and put the threshold in the alert editing.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 06:15:45 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-06-23T06:15:45Z</dc:date>
    <item>
      <title>How to split alerts by error type?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/647874#M905</link>
      <description>&lt;P&gt;Sample events:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{ 
    errorClass:  NullPointerException  
    userId: 53
},
{ 
    errorClass:  IllegalArgumentException  
    userId: 65
},
{ 
    errorClass:  NullPointerException  
    userId: 32
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of having one alert mixed with many different errors, I would like to create a new alert for every type of error:&lt;BR /&gt;Alert 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{ 
    errorClass:  NullPointerException  
    userId: 53
},
{ 
    errorClass:  NullPointerException  
    userId: 32
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alert 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{ 
    errorClass:  IllegalArgumentException  
    userId: 65
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Of course the number of errorClass can be infinite so we cannot create a dedicated alert for every errorClass. I want to try if something like:&lt;BR /&gt;&lt;BR /&gt;{baseSearch} |stats by errorClass&lt;BR /&gt;and every row in the stats table can be a new alert is possible.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 15:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/647874#M905</guid>
      <dc:creator>YatMan</dc:creator>
      <dc:date>2023-06-22T15:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Split alerts by error type</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/647879#M906</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251345"&gt;@YatMan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should try the option in alert creation "Trigger for each result" and run a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{baseSearch} 
| stats count values(userId) AS userId BY errorClass
| where count&amp;gt;3&lt;/LI-CODE&gt;&lt;P&gt;the last condition is mandatory if you need a threshold, otherwise you can avoid to use it.&lt;/P&gt;&lt;P&gt;if you want the error count for each userId, you can put this field in the BY clause:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{baseSearch} 
| stats count BY errorClass userId 
| where count&amp;gt;3&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 06:27:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/647879#M906</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-22T06:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Split alerts by error type</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/648024#M907</link>
      <description>&lt;P&gt;Thank you,&lt;BR /&gt;using | stat and&lt;SPAN&gt;"Trigger for each result"&amp;nbsp;did send me unique alert for each error!&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Is there a way I can attach the events in json format associated with each error in this alert?&lt;BR /&gt;I don't need to see the graph, I want to see the list of associated events along with the alert.&amp;nbsp;&lt;BR /&gt;The sample events I provided are of way simplified, we need the complete log (including stack trace, request Id , etc..) for onCall. I feel we are so close.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-06-22 at 21.19.39.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25988iF24D039FBB3D4249/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-06-22 at 21.19.39.png" alt="Screenshot 2023-06-22 at 21.19.39.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 04:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/648024#M907</guid>
      <dc:creator>YatMan</dc:creator>
      <dc:date>2023-06-23T04:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Split alerts by error type</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/648031#M908</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251345"&gt;@YatMan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could add to the stats command, using the values option, the fields you need.&lt;/P&gt;&lt;P&gt;To see the row events is just a little complicated: you should use table comman instead stats and put the threshold in the alert editing.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 06:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/648031#M908</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-23T06:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Split alerts by error type</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/648245#M909</link>
      <description>&lt;P&gt;Thanks for the reply. The reason we went with stats is so that we can group by error type. Not sure if the same can be done with table commands.&lt;BR /&gt;&lt;BR /&gt;With the table approach, essentially what we are looking for is :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-06-26 at 10.54.03.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26011i93E11A800A7D812C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-06-26 at 10.54.03.png" alt="Screenshot 2023-06-26 at 10.54.03.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We create a table with 2 rows, so we get 2 alerts.&lt;BR /&gt;But each row has sub rows with the fields extracted from the events. The reason is so we can track which user at what time and what API etc&lt;BR /&gt;&lt;BR /&gt;This also looks complicated, could you kindly point out if I am on the right direction?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 17:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-split-alerts-by-error-type/m-p/648245#M909</guid>
      <dc:creator>YatMan</dc:creator>
      <dc:date>2023-06-26T17:59:26Z</dc:date>
    </item>
  </channel>
</rss>

