<?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 edit my props.conf to extract a field with leading zeros as a number instead of a string by default? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-to-extract-a-field-with-leading-zeros/m-p/156749#M44088</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MyCustomSource]
EXTRACT-CONTACT_NO = ^\s*\|\s*(?:0*)?(?&amp;lt;CONTACT_NO&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The main error that was going to cause it to NEVER work is the space in your capture name between the "NO" and the "&amp;gt;".&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jun 2015 12:54:00 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-06-15T12:54:00Z</dc:date>
    <item>
      <title>How to edit my props.conf to extract a field with leading zeros as a number instead of a string by default?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-to-extract-a-field-with-leading-zeros/m-p/156748#M44087</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;I have a field which has a lot of leading zeros. Currently, this field is getting extracted as a string field. I want to extract this field as a numeric field. Following are the event details:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ContactNumber | Age | Name  | Country |
| 0001234567    | 25  | Sunny | USA     |
| 0009854676    | 32  | Vinny | UK      |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have used the following in props.conf for field extraction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MyCustomSource]
EXTRACT-CONTACT_NO = (?i)^(?:[^\t]*\t){0}(?P&amp;lt;CONTACT_NO &amp;gt;[^\t]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help?&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 12:02:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-to-extract-a-field-with-leading-zeros/m-p/156748#M44087</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-06-15T12:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf to extract a field with leading zeros as a number instead of a string by default?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-to-extract-a-field-with-leading-zeros/m-p/156749#M44088</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MyCustomSource]
EXTRACT-CONTACT_NO = ^\s*\|\s*(?:0*)?(?&amp;lt;CONTACT_NO&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The main error that was going to cause it to NEVER work is the space in your capture name between the "NO" and the "&amp;gt;".&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 12:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-to-extract-a-field-with-leading-zeros/m-p/156749#M44088</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-15T12:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my props.conf to extract a field with leading zeros as a number instead of a string by default?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-to-extract-a-field-with-leading-zeros/m-p/156750#M44089</link>
      <description>&lt;P&gt;Hello! Try this and let me know what happen. If not working, please let me ge a sample of your raw data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MyCustomSource]
 EXTRACT-CONTACT_NO =^ [|\t0]+(?P&amp;lt;CONTACT_NO &amp;gt;\d+)\s+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 13:02:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-props-conf-to-extract-a-field-with-leading-zeros/m-p/156750#M44089</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-15T13:02:02Z</dc:date>
    </item>
  </channel>
</rss>

