<?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: Get the exception and Error in Splunk query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541009#M153144</link>
    <description>&lt;P&gt;You don't have anything in your example that contains "Message": so ErrorMessage would not contain anything - what were you expecting it to hold?&lt;/P&gt;</description>
    <pubDate>Tue, 23 Feb 2021 13:16:30 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-02-23T13:16:30Z</dc:date>
    <item>
      <title>Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541002#M153141</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;am trying to build a splunk query to get the error summary from a log. I want to capture all the events where there is some ERROR, Exception or Failure.&lt;/P&gt;&lt;P&gt;Below is the sample data :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR org.mule.component.ComponentException: Failed to invoke ScriptComponent{bapmFlow.component.797791858}. Component that caused exception is: ScriptComponent{bapmFlow.component.797791858}.
host = host1 = /odt/mule_/logs/bapm.logsourcetype = gdt_index
2/7/21
12:00:04.000 AM 
2021-02-07 00:00:04,422 [[Java2python].bapmFlow.stage1.03] ERROR org.mule.exception.CatchMessagingExceptionStrategy - Failed to dispatch message to error queue after it failed to process.  This may cause message loss. Message identification summary here: id=54972f10-6901-11eb-ad2a-0050568f5886 correlationId=&amp;lt;not set&amp;gt;, correlationGroup=-1, correlationSeq=-1
host = host1 = /odt/mule_/logs/bapm.logsourcetype = gdt_index

2021-02-07 00:00:04,407 [[Java2python].bapmFlow.stage1.03] ERROR org.mule.exception.CatchMessagingExceptionStrategy - 
********************************************************************************
Message               : org.mule.module.db.internal.domain.connection.ConnectionCreationException: Cannot get connection for URL jdbc:sqlserver://VLTROUXRPT.us.global.crux.com\PRS:1713;databaseName=DFT;domain=US;integratedSecurity=false;authenticationScheme=JavaKerberos;userName=Jack;password=&amp;lt;&amp;lt;credentials&amp;gt;&amp;gt;;trustServerCertificate=true;encrypt=true; : Login failed for user 'Jack'. ClientConnectionId:34edad77-7de1-4d0f-bc13-0fb7f090f722 (java.sql.SQLException)


2021-02-07 00:00:02,936 [[Java2python].bapmFlow.stage1.03] ERROR org.mule.exception.CatchMessagingExceptionStrategy - 
... 89 lines omitted ...
2021-02-07 00:00:02,951 [[Java2python].bapmFlow.stage1.03] ERROR org.mule.exception.CatchMessagingExceptionStrategy - Failed to dispatch message to error queue after it failed to process.  This may cause message loss. Message identification summary here: id=54970800-6901-11eb-a3d3-0050568f5165 correlationId=&amp;lt;not set&amp;gt;, correlationGroup=-1, correlationSeq=-1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have noticed the below: The ERROR keyword before the failures with the exception name. So I built this basic query like below but it's not giving the desired results:&lt;/P&gt;&lt;PRE&gt;index=hdt  sourcetype=gdt_index ("ERROR" AND "Exception") OR "FAILED"
| rex ".*?(?&amp;lt;Exception&amp;gt;(\w+\.)+\w*Exception).*"
| rex "(?&amp;lt;ErrorMessage&amp;gt;\"Message\":(.*\",))"
| stats values(ErrorMessage) as ErrorMessage by Exception&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 11:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541002#M153141</guid>
      <dc:creator>bhartiya008</dc:creator>
      <dc:date>2021-02-23T11:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541009#M153144</link>
      <description>&lt;P&gt;You don't have anything in your example that contains "Message": so ErrorMessage would not contain anything - what were you expecting it to hold?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 13:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541009#M153144</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-02-23T13:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541018#M153147</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Yes ..You are right. I was trying to follow the examples I had in my project.&lt;BR /&gt;I want the message of the failures which comes right after the exception&lt;BR /&gt;For e.g.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Failed to invoke ScriptComponent{bapmFlow.component.797791858}. Component that caused exception is: ScriptComponent{bapmFlow.component.797791858}.&lt;/PRE&gt;&lt;PRE&gt;Cannot get connection for URL jdbc:sqlserver://VLTROUXRPT.us.global.crux.com\PRS:1713;databaseName=DFT;domain=US;integratedSecurity=false;authenticationScheme=JavaKerberos;userName=Jack;password=&amp;lt;&amp;lt;credentials&amp;gt;&amp;gt;;trustServerCertificate=true;encrypt=true; : Login failed for user 'Jack'. ClientConnectionId:34edad77-7de1-4d0f-bc13-0fb7f090f722 (java.sql.SQLException)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;I want the exception name and the messages with which it failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 14:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541018#M153147</guid>
      <dc:creator>bhartiya008</dc:creator>
      <dc:date>2021-02-23T14:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541020#M153149</link>
      <description>&lt;P&gt;You can get both values from one rex expression - I extended the Exception part to include other words such as Strategy to get the complete name of the exception, then skip over the non-words (spaces, colons, etc.), then assume the remainder of the line was the error message you wanted.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex ".*?(?&amp;lt;Exception&amp;gt;(\w+\.)+\w*Exception\w*)\W+(?&amp;lt;ErrorMessage&amp;gt;.*)"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Feb 2021 14:45:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541020#M153149</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-02-23T14:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541024#M153150</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;--This looks Perfect to me!!&lt;BR /&gt;Thanks !!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 14:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541024#M153150</guid>
      <dc:creator>bhartiya008</dc:creator>
      <dc:date>2021-02-23T14:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541025#M153151</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Can you also please explain a bit about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 14:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541025#M153151</guid>
      <dc:creator>bhartiya008</dc:creator>
      <dc:date>2021-02-23T14:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541031#M153156</link>
      <description>&lt;LI-CODE lang="markup"&gt;".*?(?&amp;lt;Exception&amp;gt;(\w+\.)+\w*Exception\w*)\W+(?&amp;lt;ErrorMessage&amp;gt;.*)"
.*? - not really needed since * means 0 or more so could match anything or nothing
(?&amp;lt;Exception&amp;gt;(\w+\.)+\w*Exception\w*) - first capture group
  &amp;lt;Exception&amp;gt; - name of field
  (\w+\.)+ - one or more groups of "letters" followed by a . e.g. class in exception class hierarchy
  \w*Exception - zero or more "letters" followed by Exception
  \w* - zero or more "letters"
  Strings which match this are put into the Exception field (assuming the rest of the expression matches)
\W+ - one or more "non-letter" e.g. punctuation and spaces
(?&amp;lt;ErrorMessage&amp;gt;.*) - second capture group
  &amp;lt;ErrorMessage&amp;gt; - name of field
  .* - zero or more of anything until end of the line&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541031#M153156</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-02-23T15:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get the exception and Error in Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541034#M153157</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Thank you so much!! This will help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 15:35:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-exception-and-Error-in-Splunk-query/m-p/541034#M153157</guid>
      <dc:creator>bhartiya008</dc:creator>
      <dc:date>2021-02-23T15:35:15Z</dc:date>
    </item>
  </channel>
</rss>

