<?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: regex - Remove characters from results field. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452348#M99413</link>
    <description>&lt;P&gt;To extract the numeric portion into a new field, this rex command should do the job.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=foo "(?&amp;lt;newfield&amp;gt;\d+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To replace the entire field with just the numeric portion, try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=foo mode=sed "s/([^\d]+)(\d+)(.*)/\2/" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Aug 2019 14:58:48 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-08-16T14:58:48Z</dc:date>
    <item>
      <title>regex - Remove characters from results field.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452347#M99412</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have produced a search result field which looks something along the lines of BC000000$@ab.firmakhueny.abc\     (I have obfuscated the data however they are the same category). &lt;/P&gt;

&lt;P&gt;What I would like to create is a regex or something similar which may do the job better to remove all data before and after "000000" and to only present this field in the table created. To confirm I have replicated the original field and added in quotation marks presenting the data that we would like presented after the regex - BC"000000"$@ab.firmakhueny.abc\    .&lt;/P&gt;

&lt;P&gt;Thank you for the support in adavance.&lt;/P&gt;

&lt;P&gt;N. &lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 14:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452347#M99412</guid>
      <dc:creator>nlisle</dc:creator>
      <dc:date>2019-08-16T14:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: regex - Remove characters from results field.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452348#M99413</link>
      <description>&lt;P&gt;To extract the numeric portion into a new field, this rex command should do the job.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=foo "(?&amp;lt;newfield&amp;gt;\d+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To replace the entire field with just the numeric portion, try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=foo mode=sed "s/([^\d]+)(\d+)(.*)/\2/" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Aug 2019 14:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452348#M99413</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-16T14:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: regex - Remove characters from results field.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452349#M99414</link>
      <description>&lt;P&gt;Thank you for your response richgalloway. I have implemented the second rex command to replace the entire field with the six character numeric field from the initial search field however I am given this result "$2".&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
N &lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 15:15:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452349#M99414</guid>
      <dc:creator>nlisle</dc:creator>
      <dc:date>2019-08-16T15:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: regex - Remove characters from results field.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452350#M99415</link>
      <description>&lt;P&gt;Ah, sorry about that.  Regex101.com and Splunk use different substitution methods.  I've corrected my answer.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 16:40:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452350#M99415</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-16T16:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: regex - Remove characters from results field.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452351#M99416</link>
      <description>&lt;P&gt;Thanks that worked!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 17:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-Remove-characters-from-results-field/m-p/452351#M99416</guid>
      <dc:creator>nlisle</dc:creator>
      <dc:date>2019-08-16T17:02:58Z</dc:date>
    </item>
  </channel>
</rss>

