<?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 irrelevant 0's from a field value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479302#M134333</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I need help with this problem again.&lt;BR /&gt;
So as previously stated i only want to remove the zero's in the middle , but the options given above seem to remove all 0's.&lt;/P&gt;

&lt;P&gt;so lets say my external ID is 867182000000921046&lt;BR /&gt;
i want my table to show 867182921046&lt;/P&gt;

&lt;P&gt;but the above options are removing all 0's and giving me 86718292146&lt;/P&gt;

&lt;P&gt;any ideas how i can do this. &lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2020 14:06:26 GMT</pubDate>
    <dc:creator>paulw10</dc:creator>
    <dc:date>2020-03-26T14:06:26Z</dc:date>
    <item>
      <title>Remove irrelevant 0's from a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479298#M134329</link>
      <description>&lt;P&gt;Hey,&lt;BR /&gt;
I have a field called externalID with values like the following &lt;/P&gt;

&lt;P&gt;1766000000009834&lt;BR /&gt;
1766000000009835&lt;BR /&gt;
1766000000009836&lt;/P&gt;

&lt;P&gt;and i am looking for a way to remove all the 0's in the middle when i output to a table and then rename the field to something like shortID , so the table output would show the following values&lt;/P&gt;

&lt;P&gt;17669834&lt;BR /&gt;
17669835&lt;BR /&gt;
17669836&lt;/P&gt;

&lt;P&gt;I have tried playing around with functions like eval, ltrim, replace...etc and not getting anywhere.&lt;/P&gt;

&lt;P&gt;can anyone help me out. &lt;/P&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;Hi,&lt;BR /&gt;
I need help with this problem again.&lt;BR /&gt;
So as previously stated i only want to remove the zero's in the middle , but the options given above seem to remove all 0's.&lt;/P&gt;

&lt;P&gt;so lets say my external ID is 867182000000921046&lt;BR /&gt;
i want my table to show 867182921046&lt;/P&gt;

&lt;P&gt;but the above options are removing all 0's and giving me 86718292146&lt;/P&gt;

&lt;P&gt;any ideas how i can do this. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 12:51:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479298#M134329</guid>
      <dc:creator>paulw10</dc:creator>
      <dc:date>2020-02-26T12:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Remove irrelevant 0's from a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479299#M134330</link>
      <description>&lt;P&gt;There are at least two ways to do that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval externalID = replace(externalID, "0{2,}", "")

... | rex field = externalID mode=sed "s/0{2,}//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Feb 2020 13:56:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479299#M134330</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-26T13:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Remove irrelevant 0's from a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479300#M134331</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this also&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval test=17660000009834 
| rex field=test max_match=0 "(?P&amp;lt;temp&amp;gt;[1-9]+)" 
| eval result = mvjoin(temp,"") 
| table test,result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Feb 2020 14:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479300#M134331</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-02-26T14:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Remove irrelevant 0's from a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479301#M134332</link>
      <description>&lt;P&gt;Excellent. thank you both &lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 14:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479301#M134332</guid>
      <dc:creator>paulw10</dc:creator>
      <dc:date>2020-02-26T14:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Remove irrelevant 0's from a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479302#M134333</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I need help with this problem again.&lt;BR /&gt;
So as previously stated i only want to remove the zero's in the middle , but the options given above seem to remove all 0's.&lt;/P&gt;

&lt;P&gt;so lets say my external ID is 867182000000921046&lt;BR /&gt;
i want my table to show 867182921046&lt;/P&gt;

&lt;P&gt;but the above options are removing all 0's and giving me 86718292146&lt;/P&gt;

&lt;P&gt;any ideas how i can do this. &lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 14:06:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479302#M134333</guid>
      <dc:creator>paulw10</dc:creator>
      <dc:date>2020-03-26T14:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Remove irrelevant 0's from a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479303#M134334</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I need help with this problem again.&lt;BR /&gt;
So as previously stated i only want to remove the zero's in the middle , but the options given above seem to remove all 0's.&lt;/P&gt;

&lt;P&gt;so lets say my external ID is 867182000000921046&lt;BR /&gt;
i want my table to show 867182921046&lt;/P&gt;

&lt;P&gt;but the above options are removing all 0's and giving me 86718292146&lt;/P&gt;

&lt;P&gt;any ideas how i can do this. &lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 14:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479303#M134334</guid>
      <dc:creator>paulw10</dc:creator>
      <dc:date>2020-03-26T14:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Remove irrelevant 0's from a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479304#M134335</link>
      <description>&lt;P&gt;Please see my updated answer.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 12:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-irrelevant-0-s-from-a-field-value/m-p/479304#M134335</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-27T12:43:57Z</dc:date>
    </item>
  </channel>
</rss>

