<?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 append zeros to the beginning of existing numeric values for a field to make each value 6 digits long? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287610#M87069</link>
    <description>&lt;P&gt;Yup, updated the answer with the field name for input and output.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 16:47:48 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-04-12T16:47:48Z</dc:date>
    <item>
      <title>How to append zeros to the beginning of existing numeric values for a field to make each value 6 digits long?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287606#M87065</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I was wondering if anyone may be able to help. We have an existing field with numbers from 2 up to 6 digits.&lt;/P&gt;

&lt;P&gt;09&lt;BR /&gt;
03&lt;BR /&gt;
465&lt;BR /&gt;
498&lt;BR /&gt;
3895&lt;BR /&gt;
6409&lt;BR /&gt;
85939&lt;BR /&gt;
37624&lt;BR /&gt;
847809&lt;BR /&gt;
783906&lt;/P&gt;

&lt;P&gt;I would like to be able to append zero's to the list so they will all have 6 digits as below&lt;/P&gt;

&lt;P&gt;000009&lt;BR /&gt;
000003&lt;BR /&gt;
000465&lt;BR /&gt;
000498&lt;BR /&gt;
003895&lt;BR /&gt;
006409&lt;BR /&gt;
085939&lt;BR /&gt;
037624&lt;BR /&gt;
847809&lt;BR /&gt;
783906&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 21:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287606#M87065</guid>
      <dc:creator>ajdyer2000</dc:creator>
      <dc:date>2016-04-11T21:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to append zeros to the beginning of existing numeric values for a field to make each value 6 digits long?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287607#M87066</link>
      <description>&lt;P&gt;You can use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval SerialNumber = substr("00000", 0, max(6-len(SerialNumber), 0)) . SerialNumber
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2016 22:14:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287607#M87066</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-11T22:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to append zeros to the beginning of existing numeric values for a field to make each value 6 digits long?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287608#M87067</link>
      <description>&lt;P&gt;thanks Martin. the field name is "SerialNumber" how would I incorporate that into the eval command? &lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 12:57:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287608#M87067</guid>
      <dc:creator>ajdyer2000</dc:creator>
      <dc:date>2016-04-12T12:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to append zeros to the beginning of existing numeric values for a field to make each value 6 digits long?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287609#M87068</link>
      <description>&lt;P&gt;Replace 'input' with 'SerialNumber'. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 13:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287609#M87068</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-12T13:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to append zeros to the beginning of existing numeric values for a field to make each value 6 digits long?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287610#M87069</link>
      <description>&lt;P&gt;Yup, updated the answer with the field name for input and output.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287610#M87069</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-12T16:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to append zeros to the beginning of existing numeric values for a field to make each value 6 digits long?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287611#M87070</link>
      <description>&lt;P&gt;Thank you martin that worked&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 17:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-zeros-to-the-beginning-of-existing-numeric-values/m-p/287611#M87070</guid>
      <dc:creator>ajdyer2000</dc:creator>
      <dc:date>2016-04-13T17:55:19Z</dc:date>
    </item>
  </channel>
</rss>

