<?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: Exception matching in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146297#M40857</link>
    <description>&lt;P&gt;Hi sure it does, you must include &lt;CODE&gt;\&lt;/CODE&gt; like this&lt;BR /&gt;
&lt;CODE&gt;((\w+\.){2,6})(?&amp;lt;test&amp;gt;\w+\b)&lt;/CODE&gt;&lt;BR /&gt;
it will create new fields called test&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2013 09:52:59 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2013-11-25T09:52:59Z</dc:date>
    <item>
      <title>Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146290#M40850</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
i'm currently using following regex to match different types of exception.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;(?i:[^.]+.)*(?P&lt;TEST&gt;[a-zA-Z]+Exception)&lt;/TEST&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;sample log&lt;/P&gt;

&lt;P&gt;06 Sep 2013 18:59:59,924 [WebContainer : 4] ERROR - Remote Exception while updating CSA Details&lt;/P&gt;

&lt;P&gt;java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: &lt;BR /&gt;
java.rmi.RemoteException: ; nested exception is: &lt;BR /&gt;
    &lt;STRONG&gt;org.springframework.jdbc.UncategorizedSQLException:&lt;/STRONG&gt;    CallableStatementCallb&lt;BR /&gt;
``ack; uncategorized &lt;STRONG&gt;SQLException&lt;/STRONG&gt; for SQL [{call&lt;BR /&gt;
 PX_CO_AC_AGREEMENT_MASTER_PG.spt_update(?, ?, ?, ?, ?, ?)}]; SQL state [72000]; error code &lt;/P&gt;

&lt;P&gt;[20002]; ORA-20002: Record has been modified since last retrieved - Resubmit transaction for &lt;/P&gt;

&lt;P&gt;parameter(s)   p_acag_agreement_id_in  values of which are =&amp;gt; 1463755&lt;/P&gt;

&lt;P&gt;ORA-06512: at "ACCOUNT_OWNER.PX_CO_AC_AGREEMENT_MASTER_PG", line 91&lt;/P&gt;

&lt;P&gt;ORA-06510: PL/SQL: unhandled user-defined exception&lt;/P&gt;

&lt;P&gt;ORA-06512: at line 1&lt;/P&gt;

&lt;P&gt;; nested exception is java.sql.SQLException: ORA-20002: Record has been modified since last &lt;/P&gt;

&lt;P&gt;retrieved - Resubmit transaction for parameter(s)   p_acag_agreement_id_in  values of which are &lt;/P&gt;

&lt;P&gt;=&amp;gt; 1463755&lt;BR /&gt;
ORA-06512: at "ACCOUNT_OWNER.PX_CO_AC_AGREEMENT_MASTER_PG", line 91&lt;/P&gt;

&lt;P&gt;ORA-06510: PL/SQL: unhandled user-defined exception&lt;/P&gt;

&lt;P&gt;ORA-06512: at line 1&lt;/P&gt;

&lt;P&gt;the regex is matching SQLException(Bold) but i need match UncategorizedSQLException(Bold) once from the above log entry.&lt;/P&gt;

&lt;P&gt;i tried like even like this (?i:[^.]+.)*(?P[a-zA-Z]+Exception|UncategorizedSQLException)but it was not successfull.&lt;/P&gt;

&lt;P&gt;Any help on this.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146290#M40850</guid>
      <dc:creator>prad18</dc:creator>
      <dc:date>2020-09-28T15:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146291#M40851</link>
      <description>&lt;P&gt;Hi prad18&lt;/P&gt;

&lt;P&gt;quick one would be like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (?&amp;lt;test&amp;gt;(\sSQL|(\w+\.){3}\w+SQL)+Exception)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this matches &lt;STRONG&gt;org.springframework.jdbc.UncategorizedSQLException&lt;/STRONG&gt; and &lt;STRONG&gt;SQLException&lt;/STRONG&gt; &lt;BR /&gt;
You can test your regex by using this nice &lt;A href="http://gskinner.com/RegExr/"&gt;online regex tester&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2013 12:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146291#M40851</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-11-18T12:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146292#M40852</link>
      <description>&lt;P&gt;It is matching only org.springframework.jdbc.UncategorizedSQLException, SQLException these&lt;/P&gt;

&lt;P&gt;But actually I need to match following &lt;BR /&gt;
An Error has occured for com.marsh.csa.exception.NoClientInfoFound:--&amp;gt;NoClientInfoFound&lt;BR /&gt;
handleException():com.marsh.framework.core.exception.MarshException:--&amp;gt;MarshException &lt;BR /&gt;
Found Exception, class:java.lang.NullPointerException--&amp;gt;NullPointerException&lt;BR /&gt;
org.springframework.dao.DataAccessResourceFailureException--&amp;gt;DataAccessResourceFailureException&lt;BR /&gt;
org.springframework.jdbc.UncategorizedSQLException--&amp;gt;UncategorizedSQLException&lt;/P&gt;

&lt;P&gt;Just last words not entire package name.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2013 06:09:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146292#M40852</guid>
      <dc:creator>prad18</dc:creator>
      <dc:date>2013-11-19T06:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146293#M40853</link>
      <description>&lt;P&gt;well that was what you requested in first place &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
To match the last word in any of the above provided errors you could use something like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;((\w+\.){2,6})(?&amp;lt;test&amp;gt;\w+\b)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;cheers&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 09:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146293#M40853</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-11-20T09:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146294#M40854</link>
      <description>&lt;P&gt;As suggested in @MuS answer, try the different values in a regex tester (you could also use the built-in one in Splunk Web).&lt;/P&gt;

&lt;P&gt;I think you need to consider some other things, though:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;What are you going to use this for? In your example log, you are extracting two values from the same log event. One is the actual exception name and one is part of the exception message (&lt;CODE&gt;... ack; uncategorized SQLException for SQL ...&lt;/CODE&gt;). Additionally, the values are not the first exceptions mentioned in the event.&lt;/LI&gt;
&lt;LI&gt;Do you only want actual exceptions? In that case, consider that some exceptions might not be &lt;EM&gt;called&lt;/EM&gt; &lt;CODE&gt;Exception&lt;/CODE&gt;. You might need to detect exceptions based on position, or by filtering your results to only events that should mention exceptions.&lt;/LI&gt;
&lt;LI&gt;Some exceptions might have the same class names, but different fully-qualified names (e.g. &lt;CODE&gt;com.foo.framework.net.http.NotFoundException&lt;/CODE&gt; and &lt;CODE&gt;org.bar.gofish.hand.NotFoundException&lt;/CODE&gt;). If you're doing statistics based on these extractions, that could give you bad results.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 20 Nov 2013 12:54:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146294#M40854</guid>
      <dc:creator>laserval</dc:creator>
      <dc:date>2013-11-20T12:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146295#M40855</link>
      <description>&lt;P&gt;Hi MuS,&lt;BR /&gt;
((w+.){2,6})(?&lt;TEST&gt;w+b) is not matching any of the above error's last word. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/TEST&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 05:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146295#M40855</guid>
      <dc:creator>prad18</dc:creator>
      <dc:date>2013-11-25T05:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146296#M40856</link>
      <description>&lt;P&gt;hi laserval,&lt;BR /&gt;
I need to extract one exception from each event and show the count in the form of chat.&lt;BR /&gt;
The above example log is one event in which initially I extracted java.rmi.ServerException-&amp;gt; "Server exception" but now I've to match org.springframework.jdbc.UncategorizedSQLException -&amp;gt;  "UncategorizedSQLException" instead of Server exception.&lt;/P&gt;

&lt;P&gt;Yeah last point is valid one there could be different fully-qualified names. Any suggestion on how to tackle this problem.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 05:29:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146296#M40856</guid>
      <dc:creator>prad18</dc:creator>
      <dc:date>2013-11-25T05:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146297#M40857</link>
      <description>&lt;P&gt;Hi sure it does, you must include &lt;CODE&gt;\&lt;/CODE&gt; like this&lt;BR /&gt;
&lt;CODE&gt;((\w+\.){2,6})(?&amp;lt;test&amp;gt;\w+\b)&lt;/CODE&gt;&lt;BR /&gt;
it will create new fields called test&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 09:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146297#M40857</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-11-25T09:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146298#M40858</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;I need to extract one exception from each event and show the count in the form of chat.&lt;BR /&gt;
The above example log is one event in which initially I extracted java.rmi.ServerException-&amp;gt; "Server exception"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;You could have an extraction that creates a multivalue field. Then you could filter out &lt;CODE&gt;ServerException&lt;/CODE&gt; and other generic ones when doing the stats and chart, so your chart can include any new exceptions that turn up.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Any suggestion on how to tackle this problem.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Extract the whole name, then categorize afterwards, e.g. &lt;CODE&gt;stats count(eval(match(exception, "SQL"))) as SQLExceptions&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 09:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146298#M40858</guid>
      <dc:creator>laserval</dc:creator>
      <dc:date>2013-11-26T09:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146299#M40859</link>
      <description>&lt;P&gt;while posting comments slashes are being removed. I made typo with rex command that's why it was not working then i added assetion like ((w+.){2,6})(?&lt;TEST&gt;w+b)(?&amp;lt;=Exception|NoClientInfoFound|DataAccessResourceFailureException) and it matched all exceptions.&lt;/TEST&gt;&lt;/P&gt;

&lt;P&gt;Thanks a lot for help MuS&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 09:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146299#M40859</guid>
      <dc:creator>prad18</dc:creator>
      <dc:date>2013-11-27T09:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146300#M40860</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;You could have an extraction that creates a multivalue field.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;How can i do this, any example or doc?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 09:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146300#M40860</guid>
      <dc:creator>prad18</dc:creator>
      <dc:date>2013-11-27T09:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Exception matching</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146301#M40861</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;How can i do this, any example or doc?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;You probably found a solution, but: &lt;CODE&gt;rex max_match=0 ...&lt;/CODE&gt; will extract as many values as there are, and make the field multivalued. See &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/rex"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/rex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2014 13:06:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exception-matching/m-p/146301#M40861</guid>
      <dc:creator>laserval</dc:creator>
      <dc:date>2014-01-22T13:06:12Z</dc:date>
    </item>
  </channel>
</rss>

