<?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: Field extraction using rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-using-rex/m-p/31269#M6440</link>
    <description>&lt;P&gt;Try this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=sharepoint | rex "\sMore\sinformation:\s(?&amp;lt;my_err_code&amp;gt;[\dxA-F]+)" | table my_err_code
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can skip the &lt;CODE&gt;A-F&lt;/CODE&gt; in the character class if only numbers and 'x' are valid.&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2013 10:01:30 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-08-12T10:01:30Z</dc:date>
    <item>
      <title>Field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-using-rex/m-p/31268#M6439</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a field called message and now i'm trying to extract a ErrorIdentifier from that message field.&lt;BR /&gt;
Below is the sample log entries of sharepoint:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;7/8/13&lt;BR /&gt;
8:49:34.360 AM  07/08/2013 08:49:34.36  w3wp.exe (0x0AD8)                           0x698C  SharePoint Foundation           General                         8e2s    Medium      Unknown SPRequest error occurred. More information: 0x80070005  880cf2d3-7093-4a52-94dc-4261ccdbf2aa &lt;BR /&gt;
7/8/13&lt;BR /&gt;
8:27:26.670 AM  07/08/2013 08:27:26.67  w3wp.exe (0x0AD8)                           0x9404  SharePoint Foundation           General                         8e2s    Medium      Unknown SPRequest error occurred. More information: 0x80070002 &lt;BR /&gt;
7/8/13&lt;BR /&gt;
10:12:04.460 AM  07/08/2013 10:12:04.46     w3wp.exe (0x0AD8)                           0x4CB4  SharePoint Foundation           Monitoring                      b4ly    Medium      Leaving Monitored Scope (Request (GET:https://www.myvantageconnect.co.in:443/_LAYOUTS/ClientPortal/SilverlightWebParts/PROD/System.ComponentModel.Composition.zip)). Execution Time=34.7719304398&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Here i just want extract a patterns "&lt;STRONG&gt;0x80070005&lt;/STRONG&gt;" from message field.&lt;BR /&gt;
I tried with this regex :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="sharepoint" | rex field=msg "(?i) .*?: (?P&amp;lt;FieldIdentifier&amp;gt;\d+\w+)(?=\t)" | table ErrorIdentifier
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i do so it's not extracting the desirable output.&lt;/P&gt;

&lt;P&gt;Note: The pattern always followed by the word "More information:" in a message field.&lt;BR /&gt;
So please help regarding this.&lt;/P&gt;

&lt;P&gt;Thank you  &lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2013 09:00:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-using-rex/m-p/31268#M6439</guid>
      <dc:creator>ChhayaV</dc:creator>
      <dc:date>2013-08-12T09:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-using-rex/m-p/31269#M6440</link>
      <description>&lt;P&gt;Try this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=sharepoint | rex "\sMore\sinformation:\s(?&amp;lt;my_err_code&amp;gt;[\dxA-F]+)" | table my_err_code
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can skip the &lt;CODE&gt;A-F&lt;/CODE&gt; in the character class if only numbers and 'x' are valid.&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2013 10:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-using-rex/m-p/31269#M6440</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-08-12T10:01:30Z</dc:date>
    </item>
  </channel>
</rss>

