<?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: How to generate a table that lists all Java exceptions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220159#M64717</link>
    <description>&lt;P&gt;i have account all the exceptions from 5apps and their logs &lt;/P&gt;

&lt;P&gt;Field 1 .        field .  total Occurenance&lt;BR /&gt;
Error .           xyz .      3&lt;BR /&gt;
Exception .  NPE .     2&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2017 20:17:16 GMT</pubDate>
    <dc:creator>jw44250</dc:creator>
    <dc:date>2017-01-05T20:17:16Z</dc:date>
    <item>
      <title>How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220154#M64712</link>
      <description>&lt;P&gt;I want to List all exceptions (java, spring, hibernate, etc) such as sql, unchecked, checkException plus any framework exception from a log in nice table format.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220154#M64712</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-05T16:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220155#M64713</link>
      <description>&lt;P&gt;Hi jw44250, could you please share a bit more info about your log, some sample data maybe? Thanks! &lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 17:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220155#M64713</guid>
      <dc:creator>hunters_splunk</dc:creator>
      <dc:date>2017-01-05T17:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220156#M64714</link>
      <description>&lt;P&gt;This is my logs &lt;BR /&gt;
2012-08-10 08:19:17 [SEVERE] java.lang.NullPointerException&lt;BR /&gt;
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1146)&lt;BR /&gt;
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:567)&lt;BR /&gt;
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)&lt;BR /&gt;
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:476)&lt;BR /&gt;
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)&lt;BR /&gt;
2012-08-10 08:19:17 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)&lt;BR /&gt;
java.lang.NullPointerException&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 18:26:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220156#M64714</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-05T18:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220157#M64715</link>
      <description>&lt;P&gt;Output&lt;BR /&gt;
ExceptionName               Total Occureence of Exception&lt;BR /&gt;
AllTotalException .                         60&lt;/P&gt;

&lt;P&gt;Another Output&lt;BR /&gt;
ExceptionName               Total Occureence of Exception&lt;BR /&gt;
.....SQLException .                         10&lt;BR /&gt;
.....NullPointerException .             5&lt;BR /&gt;
..........................XException .          1&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 18:28:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220157#M64715</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-05T18:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220158#M64716</link>
      <description>&lt;P&gt;Answer to this question depends on how well you know the strings which come in log when the exception occur.  For the lines of your log posted above we can do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query to return events
| rex field=_raw "\[SEVERE\](\s|\sat\s)(?&amp;lt;myException&amp;gt;[^\s\(]+)"
| stats count by myException
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A similar scenario we handled in our projects was to target only the &lt;CODE&gt;Caused by:&lt;/CODE&gt; line from the entire stack trace. Error logs we had were:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at com.citigroup.ebusiness.jfp.messaging.tibco.common.util.DOMUtils.parseXmlString(DOMUtils.java:166)
        ... 8 more
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Query to fetch these were written as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex sourcetype=mySourcetype "Caused by:"
| rex field=_raw "Caused by:\s(?&amp;lt;myException&amp;gt;[\S]+)"
| stats count by myException
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can build upon it similarly.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 19:06:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220158#M64716</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2017-01-05T19:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220159#M64717</link>
      <description>&lt;P&gt;i have account all the exceptions from 5apps and their logs &lt;/P&gt;

&lt;P&gt;Field 1 .        field .  total Occurenance&lt;BR /&gt;
Error .           xyz .      3&lt;BR /&gt;
Exception .  NPE .     2&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:17:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220159#M64717</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-05T20:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220160#M64718</link>
      <description>&lt;P&gt;thanks -- why selection "Caused by: " -- &lt;/P&gt;

&lt;P&gt;im totally new to splunk&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220160#M64718</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-05T20:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220161#M64719</link>
      <description>&lt;P&gt;That's because in our use case we were only interested in the lines having "Caused by:" from the entire stack trace; which is the actual cause of error and there might be a lot of errors/subExceptions in the stack trace:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=myIndex sourcetype=mySourcetype "Caused by:"
 | rex field=_raw "Caused by:\s(?&amp;lt;myException&amp;gt;[\S]+)"
 | stats count by myException
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your log lines which you posted should work out with this query I posted initially if that's how the errors occur in your logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your query to return events
 | rex field=_raw "\[SEVERE\](\s|\sat\s)(?&amp;lt;myException&amp;gt;[^\s\(]+)"
 | stats count by myException
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2017 00:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220161#M64719</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2017-01-06T00:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220162#M64720</link>
      <description>&lt;P&gt;thnks a lot for your help &lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 01:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220162#M64720</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-06T01:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220163#M64721</link>
      <description>&lt;P&gt;my result still not prefect ...i end up doing this :&lt;/P&gt;

&lt;P&gt;index=index1 sourcetype=index1_log1 "Caused by:"&lt;BR /&gt;
  | rex field=_raw "Caused by:\s(?[\S]+)"&lt;BR /&gt;
  | stats count by myException |appendcols[search=ndex1 sourcetype=index2_log2 "Caused by:"&lt;BR /&gt;
  | rex field=_raw "Caused by:\s(?[\S]+)"&lt;BR /&gt;
  | stats count by myException]&lt;/P&gt;

&lt;P&gt;My output is all over the places....currently try to figure the expected output since rows and columns is merges.&lt;/P&gt;

&lt;P&gt;the above query cause me issue regarding exceptions becuase the same exception (NPE) can appear in index 1 /2 or both -- getting different wrong result -- i needed to range colns order (A, B ) .   (B, A)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:25:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220163#M64721</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2020-09-29T12:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220164#M64722</link>
      <description>&lt;P&gt;Try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=index1 OR index=index2) (sourcetype=sourcetype1 OR sourcetype=sourcetype2)
| complete the query
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2017 04:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220164#M64722</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2017-01-06T04:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220165#M64723</link>
      <description>&lt;P&gt;suppose having 10 of logs files coming from 10 different applications. find total exceptions for each logs and output should look:&lt;/P&gt;

&lt;P&gt;AppList .             IndexList          ExceptionName                           Occurance .          Time &lt;BR /&gt;
App1                   index 1              java....NullPointerException .      10                          7:00am&lt;BR /&gt;
App2                   index 2              java....SQLException .            .       10                         9:00pm&lt;/P&gt;

&lt;P&gt;comments:  (index=index1 OR index=index2) . need to use AND --- (matching is needed)&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 05:00:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220165#M64723</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-06T05:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a table that lists all Java exceptions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220166#M64724</link>
      <description>&lt;P&gt;how to combine and arrang two different fields &lt;/P&gt;

&lt;P&gt;input is like this : &lt;/P&gt;

&lt;P&gt;field1 .   field2&lt;BR /&gt;
10 .         20&lt;/P&gt;

&lt;P&gt;output&lt;BR /&gt;
Final Field&lt;BR /&gt;
10&lt;BR /&gt;
20&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 16:45:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-table-that-lists-all-Java-exceptions/m-p/220166#M64724</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-09T16:45:14Z</dc:date>
    </item>
  </channel>
</rss>

