<?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 extract ErrorCode from log messages using regex? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592161#M12077</link>
    <description>&lt;P&gt;Thanks a lot, it worked&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 09:00:02 GMT</pubDate>
    <dc:creator>dezmadi</dc:creator>
    <dc:date>2022-04-04T09:00:02Z</dc:date>
    <item>
      <title>How to extract ErrorCode from log messages using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/591922#M12045</link>
      <description>&lt;P&gt;I have&amp;nbsp; messages like below in logs, I want to extract ErrorCode from Those messages, Here ErrorCode is&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;CIS-46031&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;However there could be space right after&amp;nbsp;ErrorCode or after&amp;nbsp;ErrorCode:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;msg&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;ErrorCode:CIS-46031,ErrorMessage:Some unknown error occurred in outage daemon request. Please check.,Error occurred in CIS domain events outage processing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;msg&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ErrorCode : CIS-46032,ErrorMessage:Some unknown error occurred in outage daemon request.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;msg&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ErrorCode :CIS-46033, ErrorMessage:Some unknown error occurred in outage daemon request.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;How can we do the same in Splunk&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 15:43:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/591922#M12045</guid>
      <dc:creator>dezmadi</dc:creator>
      <dc:date>2022-04-01T15:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/591931#M12047</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "ErrorCode\s*:\s*(?&amp;lt;errorcode&amp;gt;[^,]+),"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Apr 2022 11:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/591931#M12047</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-01T11:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/591934#M12048</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; , It worked&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 12:29:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/591934#M12048</guid>
      <dc:creator>dezmadi</dc:creator>
      <dc:date>2022-04-01T12:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592131#M12066</link>
      <description>&lt;P&gt;Thanks, it worked, however in visulalization, it prints as NULL if there's a space in between&lt;/P&gt;&lt;P&gt;For instance it prints NULL for&amp;nbsp;&lt;SPAN&gt;ErrorCode:&amp;nbsp; &amp;nbsp;CIS-53030&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However if it's&amp;nbsp;ErrorCode: CIS-53031, it prints correct value as&amp;nbsp;ErrorCode: CIS-53031&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 06:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592131#M12066</guid>
      <dc:creator>dezmadi</dc:creator>
      <dc:date>2022-04-04T06:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: regex</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592141#M12067</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "ErrorCode\s*:\s*(?&amp;lt;errorcode&amp;gt;[^\s,]+),"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Apr 2022 07:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592141#M12067</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-04T07:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ErrorCode from log messages using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592149#M12069</link>
      <description>&lt;P&gt;Thanks, but I am still getting it as NULL, I have pasted it below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dezmadi_0-1649060561504.png" style="width: 587px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18908i8F9C6206F857FC83/image-dimensions/587x88?v=v2" width="587" height="88" role="button" title="dezmadi_0-1649060561504.png" alt="dezmadi_0-1649060561504.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Below is the message (Here there is a space between&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;ErrorCode: and&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;CIS-53030&lt;/SPAN&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;msg&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;ErrorCode: CIS-53030 Events cannot be processed&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 08:25:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592149#M12069</guid>
      <dc:creator>dezmadi</dc:creator>
      <dc:date>2022-04-04T08:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ErrorCode from log messages using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592152#M12071</link>
      <description>&lt;P&gt;If ErrorCode: doesn't exist in your events, you will get NULL. Are you expecting all events to have ErrorCode in? If so, can you share some of the events which are not matching the rex?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "ErrorCode\s*:\s*(?&amp;lt;errorcode&amp;gt;[^\s,]+),"
| where isnull(errorcode)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Apr 2022 08:34:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592152#M12071</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-04T08:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ErrorCode from log messages using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592154#M12072</link>
      <description>&lt;P&gt;ErrorCode exist in the event, however if there is space, it's returning as null in visualisation, For instance, in below event, we have&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;ErrorCode: CIS-53030 (Here there is space between ErrorCode: and CIS-53030), it's showing as NULL&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;msg&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;ErrorCode: CIS-53030 Events cannot be processed as WFM is not provisioned for WFM ID&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 08:41:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592154#M12072</guid>
      <dc:creator>dezmadi</dc:creator>
      <dc:date>2022-04-04T08:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ErrorCode from log messages using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592156#M12074</link>
      <description>&lt;P&gt;Try it without the tail anchor ","&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "ErrorCode\s*:\s*(?&amp;lt;errorcode&amp;gt;[^\s,]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Apr 2022 08:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592156#M12074</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-04T08:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract ErrorCode from log messages using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592161#M12077</link>
      <description>&lt;P&gt;Thanks a lot, it worked&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 09:00:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-ErrorCode-from-log-messages-using-regex/m-p/592161#M12077</guid>
      <dc:creator>dezmadi</dc:creator>
      <dc:date>2022-04-04T09:00:02Z</dc:date>
    </item>
  </channel>
</rss>

