<?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: Remove Text after Numbers in Field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458315#M129407</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults 
|  eval yourField = "00000000abcde"
|  rex field=yourField mode=sed "s/^(\d+).*$/\1/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 01 Sep 2019 22:07:52 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-09-01T22:07:52Z</dc:date>
    <item>
      <title>Remove Text after Numbers in Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458310#M129402</link>
      <description>&lt;P&gt;How can I remove everything after the zeroes in a field with results like this '000000000'&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 17:48:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458310#M129402</guid>
      <dc:creator>chrisschum</dc:creator>
      <dc:date>2019-08-21T17:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Text after Numbers in Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458311#M129403</link>
      <description>&lt;P&gt;It took off the full result field because it has a less than and greater than sign&lt;/P&gt;

&lt;P&gt;000000000([less than sign]/ParticipantObjectQuery[greater than sign][less than sign]/ParticipantObjectIdentification[greater than sign][less than sign]/AuditMessage[greater than sign]"&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 17:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458311#M129403</guid>
      <dc:creator>chrisschum</dc:creator>
      <dc:date>2019-08-21T17:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Text after Numbers in Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458312#M129404</link>
      <description>&lt;P&gt;I believe you need to provide better example of values, as I don't see anything after the zeros (which portion you want to remove). If your data values are like &lt;CODE&gt;0000ABC&lt;/CODE&gt;and you want to change the value to &lt;CODE&gt;0000&lt;/CODE&gt;, then you'd do like this (in search)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..| eval fieldnamehere=replace(fieldnamehere,"^(0+)(.+)", "\1")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..| rex field=fieldnamehere mode=sed "s/^(0+)(.+)/\1/" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 18:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458312#M129404</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-08-21T18:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Text after Numbers in Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458313#M129405</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval Description="000000000&amp;lt;/ParticipantObjectQuery&amp;gt;&amp;lt;/ParticipantObjectIdentificat&amp;gt;&amp;lt;/AuditMessage[greater than sign&amp;gt;"

| rex field=Description "(?&amp;lt;Description&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 18:41:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458313#M129405</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-21T18:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Text after Numbers in Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458314#M129406</link>
      <description>&lt;P&gt;hi @chrisschum&lt;BR /&gt;
tried the above?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 20:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458314#M129406</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-21T20:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Text after Numbers in Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458315#M129407</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults 
|  eval yourField = "00000000abcde"
|  rex field=yourField mode=sed "s/^(\d+).*$/\1/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Sep 2019 22:07:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-Text-after-Numbers-in-Field/m-p/458315#M129407</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-09-01T22:07:52Z</dc:date>
    </item>
  </channel>
</rss>

