<?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 a field using rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390902#M113787</link>
    <description>&lt;P&gt;It worked too&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2019 23:18:10 GMT</pubDate>
    <dc:creator>iamtrying</dc:creator>
    <dc:date>2019-05-24T23:18:10Z</dc:date>
    <item>
      <title>How to extract a field using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390899#M113784</link>
      <description>&lt;P&gt;This is the string in the log&lt;/P&gt;

&lt;P&gt;I 2019-05-23 18:22:38.984Z 7881 216 &lt;STRONG&gt;XObk7A6CU-I62gr3UIKfXQAAAAs&lt;/STRONG&gt; 1@43465473@A WPB-Log: file=/users/aa/test.cls method=fetchdata ID=Qwe123&lt;/P&gt;

&lt;P&gt;I want to extract a field marked as bold to build a table. &lt;BR /&gt;
Please note that all strings are variable so the rex should be generic.&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 17:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390899#M113784</guid>
      <dc:creator>iamtrying</dc:creator>
      <dc:date>2019-05-24T17:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390900#M113785</link>
      <description>&lt;P&gt;Assuming that data is always in the same place this should grab it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}Z \d+ \d+ (?&amp;lt;fieldName&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll need to choose the field name you want and replace fieldName with whatever you want to label that field.  Here's a link to regex 101 that shows it working on the single example you provided: &lt;A href="https://regex101.com/r/TdkzcA/1"&gt;https://regex101.com/r/TdkzcA/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 18:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390900#M113785</guid>
      <dc:creator>dmarling</dc:creator>
      <dc:date>2019-05-24T18:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390901#M113786</link>
      <description>&lt;P&gt;Give this a try (assuming the value you want to extract is 6th element from the start)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
| rex "^(\S+\s+){5}(?&amp;lt;YourField&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2019 18:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390901#M113786</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-05-24T18:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390902#M113787</link>
      <description>&lt;P&gt;It worked too&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 23:18:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-using-rex/m-p/390902#M113787</guid>
      <dc:creator>iamtrying</dc:creator>
      <dc:date>2019-05-24T23:18:10Z</dc:date>
    </item>
  </channel>
</rss>

