<?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: Problem Removing Leading Zeros From IP Address in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134151#M27564</link>
    <description>&lt;P&gt;Could it be something else?  I'm sort of out of ideas at this point.  I even tried removing the leading zeros at search time but had a problem (I think maybe the quotes around the IP address, see below).  I'd rather have this done at index time.  Should I try to use a transform?  &lt;/P&gt;

&lt;P&gt;(this didn't work either  ... | rex field=youripfield mode=sed "s/.0+/./g")&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2015 19:06:19 GMT</pubDate>
    <dc:creator>rbacon</dc:creator>
    <dc:date>2015-07-22T19:06:19Z</dc:date>
    <item>
      <title>Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134141#M27554</link>
      <description>&lt;P&gt;Splunk is indexing a CSV file that contains an IP address and it looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Windows 7","SSHEFFIER8GDAOC","010.003.002.059","101BD9089D18"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The IP has leading zeros which I need removed and prefer to do so at index time, so based on what I've seen in the forums here I added the following SEDCMD line to the relevant props.conf file:&lt;/P&gt;

&lt;P&gt;[my:sourcetype]&lt;BR /&gt;
...(some field extractions)....&lt;BR /&gt;
EXTRACT-LD_IPAddress = (?:[^"\n]&lt;EM&gt;"){17}(?P[^"]+)&lt;BR /&gt;
SEDCMD = s/(src=|dst=)0&lt;/EM&gt;([^.]+.)0*([^.]+.)0*([^.]+.)0*(\d+)/\1\2\3\4\5/g&lt;/P&gt;

&lt;P&gt;This seems to have no effect on the data.  I double checked that the props.conf file was deployed to the indexers.  Is there something wrong with the way I did the SEDCMD (what is src &amp;amp; dst?)?  Could it be that the SEDCMD needs to be placed before the EXTRACT lines in props.conf?  Also, I wonder if the quotes around the IP address could be affecting this?&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:46:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134141#M27554</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2020-09-29T06:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134142#M27555</link>
      <description>&lt;P&gt;Is this indexed using &lt;CODE&gt;INDEXED_EXTRACTIONS=csv&lt;/CODE&gt; on the forwarder?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 16:40:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134142#M27555</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-21T16:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134143#M27556</link>
      <description>&lt;P&gt;SEDCMD happens at the parsing stage, so it applies in a heavy forwarder or in a indexer. If your forwarder is a heavy forwarder, the log data is already "cooked" when it arrives at the indexer, and the sedcmd in props.conf  there will have no effect. If the forwarder is not a heavy forwarder, this should work on the indexer.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 16:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134143#M27556</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2015-07-21T16:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134144#M27557</link>
      <description>&lt;P&gt;Hi.  We are not using a heavy forwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 17:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134144#M27557</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-21T17:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134145#M27558</link>
      <description>&lt;P&gt;Yes, in the props.conf file.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 17:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134145#M27558</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-21T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134146#M27559</link>
      <description>&lt;P&gt;If you're applying &lt;CODE&gt;INDEXED_EXTRACTIONS=csv&lt;/CODE&gt; then these events are cooked &lt;EM&gt;even on universal forwarders&lt;/EM&gt;... so anything you do with those events would have to be configured there. See &lt;A href="http://wiki.splunk.com/Community:HowIndexingWorks"&gt;http://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt; section 4, you're going through the structuredparsing queue on the forwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 17:13:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134146#M27559</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-21T17:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134147#M27560</link>
      <description>&lt;P&gt;OK.   So I should move the SEDCMD from the props.conf on the Indexer to forwarder, right?  I suppose I could move the field extractions there as well.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 17:39:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134147#M27560</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-21T17:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134148#M27561</link>
      <description>&lt;P&gt;Copy the index-time settings to the forwarder, yes. Don't move in case you ever input such a file locally. Also don't move search-time field extractions.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 17:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134148#M27561</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-21T17:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134149#M27562</link>
      <description>&lt;P&gt;So I copied the SEDCMD line to the props.conf belonging to the SplunkForwarder and reloaded the deploy server.  The changes were imported and it reread the CSV file, but it did not remove the leading zeros from the IP address.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 19:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134149#M27562</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-21T19:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134150#M27563</link>
      <description>&lt;P&gt;Also, no indication of what happened in the splunkd.log of the SplunkForwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 19:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134150#M27563</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-21T19:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134151#M27564</link>
      <description>&lt;P&gt;Could it be something else?  I'm sort of out of ideas at this point.  I even tried removing the leading zeros at search time but had a problem (I think maybe the quotes around the IP address, see below).  I'd rather have this done at index time.  Should I try to use a transform?  &lt;/P&gt;

&lt;P&gt;(this didn't work either  ... | rex field=youripfield mode=sed "s/.0+/./g")&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 19:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134151#M27564</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-22T19:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134152#M27565</link>
      <description>&lt;P&gt;I've just taken another look at your question - make sure you use &lt;CODE&gt;SEDCMD-something = ...&lt;/CODE&gt; and not &lt;CODE&gt;SEDCMD = ...&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 20:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134152#M27565</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-22T20:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134153#M27566</link>
      <description>&lt;P&gt;Hi Martin.   Is the  arbitrary?  I changed it to SEDCMD-RemoveLeadingZeros but this didn't help either.   &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 22:15:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134153#M27566</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-22T22:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134154#M27567</link>
      <description>&lt;P&gt;Yeah, that's arbitrary to avoid multiple SEDCMDs overwriting each other.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 22:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134154#M27567</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-22T22:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134155#M27568</link>
      <description>&lt;P&gt;Still no luck!  I'm going bald from pulling my hair out!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 15:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134155#M27568</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2015-07-27T15:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Removing Leading Zeros From IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134156#M27569</link>
      <description>&lt;P&gt;So here's what's being deployed in the props.conf file to the universal forwarders.  I'm getting the data but the SEDCMD isn't removing the leading zeros from IP addresses.&lt;/P&gt;

&lt;P&gt;[source::file location]&lt;/P&gt;

&lt;P&gt;[sourcetype]&lt;BR /&gt;
FIELD_DELIMITER=,&lt;BR /&gt;
FIELD_QUOTE = "&lt;BR /&gt;
DATETIME_CONFIG = CURRENT&lt;BR /&gt;
INDEXED_EXTRACTIONS = csv&lt;BR /&gt;
NO_BINARY_CHECK = 1&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
SEDCMD-StripLeadingZeros = s/(src=|dst=)0*([^.]+.)0*([^.]+.)0*([^.]+.)0*(\d+)/\1\2\3\4\5/g&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problem-Removing-Leading-Zeros-From-IP-Address/m-p/134156#M27569</guid>
      <dc:creator>rbacon</dc:creator>
      <dc:date>2020-09-29T06:47:35Z</dc:date>
    </item>
  </channel>
</rss>

