<?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 What are the best extraction methods for Java Stacktrace Errors? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380395#M6304</link>
    <description>&lt;P&gt;Hello everyone!&lt;/P&gt;

&lt;P&gt;Currently, we are demoing the Splunk Enterprise trial and are here to ask what is the most efficient ways for examining large Java stack traces?&lt;/P&gt;

&lt;P&gt;Here's an example of our stack trace:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    2018-06-07 09:55:15 ERROR ServiceBlankBlank:102 - Error 500 in method: blankblankmethodname
    Listener refused the connection with the following error:
    placehere, TNS:listener could not find protocol
    The Connection descriptor used by the client was:
    server:port/blabla
    java.sql.SQLException: Listener refused the connection with the following error:
    placehere, TNS:listener could not find available handler with matching protocol stack
    The Connection descriptor used by the client was:
    server:port/blabla
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at java.sql.DriverManager...
        at java.sql.DriverManager...
        ...........
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We have received this from a Universal Forwarder on a Linux server. Ideally, we would want to only send all the lines before the large indented stack trace to our Splunk instance so that unnecessary stack information is not included in our daily Splunk usage. &lt;/P&gt;

&lt;P&gt;From this example, we would only want to keep the top portion above the "at... at... at..." for the purposes of our logging. To make this problem more complex, we may have different stack traces as well. Usually, the common similarity is the beginning of the "at..".&lt;/P&gt;

&lt;P&gt;What are some ways that the folks from the community may handle this? We do not have the necessary access to the original source code, so we will not be able to implement the Splunk SDK method.&lt;/P&gt;

&lt;P&gt;Can we remove the unnecessary log information from Splunk directly? Would the best way be to configure the inputs.conf / prop.conf to extract the necessary information and send it over? Should we use a third party program such as FluentD or logstash to parse this?&lt;/P&gt;

&lt;P&gt;Any recommendations would be greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jun 2018 17:34:18 GMT</pubDate>
    <dc:creator>thomastaylor</dc:creator>
    <dc:date>2018-06-11T17:34:18Z</dc:date>
    <item>
      <title>What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380395#M6304</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;

&lt;P&gt;Currently, we are demoing the Splunk Enterprise trial and are here to ask what is the most efficient ways for examining large Java stack traces?&lt;/P&gt;

&lt;P&gt;Here's an example of our stack trace:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    2018-06-07 09:55:15 ERROR ServiceBlankBlank:102 - Error 500 in method: blankblankmethodname
    Listener refused the connection with the following error:
    placehere, TNS:listener could not find protocol
    The Connection descriptor used by the client was:
    server:port/blabla
    java.sql.SQLException: Listener refused the connection with the following error:
    placehere, TNS:listener could not find available handler with matching protocol stack
    The Connection descriptor used by the client was:
    server:port/blabla
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at oracle.jdbc.driver...
        at java.sql.DriverManager...
        at java.sql.DriverManager...
        ...........
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We have received this from a Universal Forwarder on a Linux server. Ideally, we would want to only send all the lines before the large indented stack trace to our Splunk instance so that unnecessary stack information is not included in our daily Splunk usage. &lt;/P&gt;

&lt;P&gt;From this example, we would only want to keep the top portion above the "at... at... at..." for the purposes of our logging. To make this problem more complex, we may have different stack traces as well. Usually, the common similarity is the beginning of the "at..".&lt;/P&gt;

&lt;P&gt;What are some ways that the folks from the community may handle this? We do not have the necessary access to the original source code, so we will not be able to implement the Splunk SDK method.&lt;/P&gt;

&lt;P&gt;Can we remove the unnecessary log information from Splunk directly? Would the best way be to configure the inputs.conf / prop.conf to extract the necessary information and send it over? Should we use a third party program such as FluentD or logstash to parse this?&lt;/P&gt;

&lt;P&gt;Any recommendations would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 17:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380395#M6304</guid>
      <dc:creator>thomastaylor</dc:creator>
      <dc:date>2018-06-11T17:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380396#M6305</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;You should use a combination of props.conf and transforms.conf files to route the unwanted data to nullQueue so that it is not counted against your daily license volume. In this case, I would write the .conf files as below&lt;/P&gt;

&lt;P&gt;In props.conf&lt;BR /&gt;
[your_custom_sourcetype]&lt;BR /&gt;
TRANSFORMS-routing=route_to_null_queue&lt;/P&gt;

&lt;P&gt;In transforms.conf:&lt;BR /&gt;
[route_to_null_queue]&lt;BR /&gt;
REGEX = (?m)\s+at\s(oracle|java)&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;More info is available at &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/Forwarding/Routeandfilterdatad" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.1/Forwarding/Routeandfilterdatad&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Let me know if this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380396#M6305</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2020-09-29T19:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380397#M6306</link>
      <description>&lt;P&gt;Since you cannot do this in the universal forwarder, it will have to be done on the indexers. I would use a &lt;CODE&gt;SEDCMD&lt;/CODE&gt; in the &lt;CODE&gt;props.conf&lt;/CODE&gt; file, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your-sourcetype-here]
SEDCMD-truncate-stacktrace = s/\s+at\s[\s\S]+//g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will take everything from the first line that starts with at least one space followed by &lt;CODE&gt;at&lt;/CODE&gt; followed by a space, clear to the end of the event and remove it from the raw event before it gets indexed. This assumes that you also have the proper line breaking, etc. for the sourcetype. Please be sure to get that done correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 23:28:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380397#M6306</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-06-13T23:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380398#M6307</link>
      <description>&lt;P&gt;For some reason, I still cannot get this working. I placed the settings in etc/apps/search/local exactly how you have described them. I also restarted the Splunk Enterprise instance and re-added the log directory. Is there more I should do?&lt;/P&gt;

&lt;P&gt;Were these steps necessary after editing these two .conf files?&lt;/P&gt;

&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 12:42:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380398#M6307</guid>
      <dc:creator>thomastaylor</dc:creator>
      <dc:date>2018-06-14T12:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380399#M6308</link>
      <description>&lt;P&gt;Can you please paste your configurations here.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 12:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380399#M6308</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-06-14T12:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380400#M6309</link>
      <description>&lt;P&gt;That's what I would suggest too. using props and transforms with nullqueue routing doesn't work, since you only want to trash part of the event. While routing applies to entire events.&lt;/P&gt;

&lt;P&gt;Never used it on stack traces, but I have seen the same solution getting applied to high volume windows events for stripping of the explanatory text sections from some of those. So I can confirm that concept works like a charm.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 12:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380400#M6309</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-14T12:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380401#M6310</link>
      <description>&lt;P&gt;Thanks for your help!&lt;/P&gt;

&lt;P&gt;In &lt;STRONG&gt;props.conf&lt;/STRONG&gt; for my sourcetype:&lt;/P&gt;

&lt;P&gt;[fbs]&lt;BR /&gt;
DATETIME_CONFIG = &lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
category = Application&lt;BR /&gt;
pulldown_type = 1&lt;BR /&gt;
TRANSFORMS-routing=route_to_null_queue&lt;/P&gt;

&lt;P&gt;In the &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt; (which I created in the directory):&lt;/P&gt;

&lt;P&gt;[route_to_null_queue]&lt;BR /&gt;
REGEX = (?m)\s+at\s(oracle|java)&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380401#M6310</guid>
      <dc:creator>thomastaylor</dc:creator>
      <dc:date>2020-09-29T20:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380402#M6311</link>
      <description>&lt;P&gt;Thank you for the input Frank! I'm trying out this method right now.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 13:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380402#M6311</guid>
      <dc:creator>thomastaylor</dc:creator>
      <dc:date>2018-06-14T13:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380403#M6312</link>
      <description>&lt;P&gt;Routing won't work, as that applies to entire events, while you want to strip out just part of a (multiline) event. Best take a look at @cpetterborg's answer.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 13:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380403#M6312</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-14T13:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: What are the best extraction methods for Java Stacktrace Errors?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380404#M6313</link>
      <description>&lt;P&gt;Thank you so much @cpetterborg ! After writing a simple event break regex, this worked like a charm.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 13:19:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/What-are-the-best-extraction-methods-for-Java-Stacktrace-Errors/m-p/380404#M6313</guid>
      <dc:creator>thomastaylor</dc:creator>
      <dc:date>2018-06-14T13:19:52Z</dc:date>
    </item>
  </channel>
</rss>

