<?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 write the regex to extract the error code from my sample log? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132279#M36074</link>
    <description>&lt;P&gt;Thanks a lot guys! I will surely try it today.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2015 20:01:26 GMT</pubDate>
    <dc:creator>swapnilkale</dc:creator>
    <dc:date>2015-07-23T20:01:26Z</dc:date>
    <item>
      <title>How to write the regex to extract the error code from my sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132276#M36071</link>
      <description>&lt;P&gt;How can I find all the error codes from the logs and show it as interesting field? &lt;BR /&gt;
e.g. &lt;CODE&gt;Message :  Information with Insured. (PL200XXX)&lt;/CODE&gt;&lt;BR /&gt;
Here PLXXXXX is the error code within the parentheses. What regex or search criteria should I use to make this work? I am new to Splunk and exploring it.&lt;/P&gt;

&lt;P&gt;Thanks a lot for your help.&lt;BR /&gt;
Swap&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 13:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132276#M36071</guid>
      <dc:creator>swapnilkale</dc:creator>
      <dc:date>2015-07-22T13:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the error code from my sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132277#M36072</link>
      <description>&lt;P&gt;This one is pretty simple.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=yoursourcetype | rex field=_raw "\((?&amp;lt;errorcode&amp;gt;[^)]+)\)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you the results you want in &lt;CODE&gt;errorcode&lt;/CODE&gt;. This is a very quick regex - if you are going to make it "production ready", don't use rex, use the props/transforms to pull it automatically.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 13:54:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132277#M36072</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-07-22T13:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the error code from my sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132278#M36073</link>
      <description>&lt;P&gt;Try:&lt;BR /&gt;
If the error code always starts with PL and there are other values between  ( )  in your data.&lt;BR /&gt;
.. | rex "\((?&amp;lt;err_code&amp;gt;PL\w+)\)"&lt;/P&gt;

&lt;P&gt;Good Luck!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 19:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132278#M36073</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-07-22T19:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the error code from my sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132279#M36074</link>
      <description>&lt;P&gt;Thanks a lot guys! I will surely try it today.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 20:01:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-error-code-from-my-sample/m-p/132279#M36074</guid>
      <dc:creator>swapnilkale</dc:creator>
      <dc:date>2015-07-23T20:01:26Z</dc:date>
    </item>
  </channel>
</rss>

