<?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 Transforming 18 digit numbers into 15 digits in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Transforming-18-digit-numbers-into-15-digits/m-p/122912#M25413</link>
    <description>&lt;P&gt;I want to transform 18 digit numbers into 15 digit by dropping last 3 digits. Could someone please guide me for that?&lt;BR /&gt;
Props.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[weblog]
TRANSFORMS = numbers
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[numbers]
SOURCE_KEY = _raw
REGEX = xxxx\"\:\d+
FORMAT = \d{15}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 04 Apr 2015 17:24:30 GMT</pubDate>
    <dc:creator>satishsdange</dc:creator>
    <dc:date>2015-04-04T17:24:30Z</dc:date>
    <item>
      <title>Transforming 18 digit numbers into 15 digits</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Transforming-18-digit-numbers-into-15-digits/m-p/122912#M25413</link>
      <description>&lt;P&gt;I want to transform 18 digit numbers into 15 digit by dropping last 3 digits. Could someone please guide me for that?&lt;BR /&gt;
Props.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[weblog]
TRANSFORMS = numbers
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[numbers]
SOURCE_KEY = _raw
REGEX = xxxx\"\:\d+
FORMAT = \d{15}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Apr 2015 17:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Transforming-18-digit-numbers-into-15-digits/m-p/122912#M25413</guid>
      <dc:creator>satishsdange</dc:creator>
      <dc:date>2015-04-04T17:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming 18 digit numbers into 15 digits</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Transforming-18-digit-numbers-into-15-digits/m-p/122913#M25414</link>
      <description>&lt;P&gt;I'm not quite sure where you're going with this, so I'll make up my own example. Say this is your log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;timestamp&amp;gt; some text here number=123456789012345678
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You want to extract the first fifteen digits? You could do this in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[weblog]
EXTRACT-fifteen = number=(?&amp;lt;fifteen&amp;gt;\d{15})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it's important that there are exactly three numbers dropped off the end you can extend the expression like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[weblog]
EXTRACT-fifteen = number=(?&amp;lt;fifteen&amp;gt;\d{15})\d\d\d(?!\d)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll look for digits 16, 17, and 18 as well as make sure there's no digit 19 that might change the meaning of the event entirely.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 22:05:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Transforming-18-digit-numbers-into-15-digits/m-p/122913#M25414</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-04-04T22:05:41Z</dc:date>
    </item>
  </channel>
</rss>

