<?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 transform a numeric field at index-time (from microseconds to milliseconds)? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195783#M38947</link>
    <description>&lt;P&gt;They are standard Apache logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;179.31.12.34 - - [26/Aug/2015:14:26:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 9565
179.31.12.34 - - [26/Aug/2015:14:31:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 22270
179.31.12.34 - - [26/Aug/2015:14:36:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 17775
179.31.12.34 - - [26/Aug/2015:14:41:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 19384
179.31.12.34 - - [26/Aug/2015:14:46:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 15199
179.31.12.34 - - [26/Aug/2015:14:51:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 13081
179.31.12.34 - - [26/Aug/2015:14:56:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 14866
179.31.12.34 - - [26/Aug/2015:15:01:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 14962
179.31.12.34 - - [26/Aug/2015:15:06:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 14313
179.31.12.34 - - [26/Aug/2015:15:11:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 18321
179.31.12.34 - - [26/Aug/2015:15:16:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 18693
179.31.12.34 - - [26/Aug/2015:15:21:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 15301
179.31.12.34 - - [26/Aug/2015:15:26:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 15142
179.31.12.34 - - [26/Aug/2015:15:31:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 18524
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The last field being the request time in microseconds.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Aug 2015 20:44:23 GMT</pubDate>
    <dc:creator>splunkmasterfle</dc:creator>
    <dc:date>2015-08-27T20:44:23Z</dc:date>
    <item>
      <title>How to transform a numeric field at index-time (from microseconds to milliseconds)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195781#M38945</link>
      <description>&lt;P&gt;This is my situation:&lt;/P&gt;

&lt;P&gt;I am currently using an older version of Apache which does not allow request times to be logged in milliseconds. I can't update the version of Apache until our next official release of our application that is in over a year. Eventually, the requests will be logged in milliseconds. In order to prevent conflicts at the point where the field becomes milliseconds, I want to transform the current value of the field (it's in microseconds) to milliseconds at index-time. This would mean that once the new version of Apache logs the requests in milliseconds, it will not affect the older data that isn't in the same format.&lt;/P&gt;

&lt;P&gt;Is there a way to implement a temporary transformation of the field that gets indexed that could be removed once the modification has taken place?&lt;/P&gt;

&lt;P&gt;For context: I am using a single indexer with multiple forwarders that send the logs to be indexed.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 17:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195781#M38945</guid>
      <dc:creator>splunkmasterfle</dc:creator>
      <dc:date>2015-08-27T17:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a numeric field at index-time (from microseconds to milliseconds)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195782#M38946</link>
      <description>&lt;P&gt;What is the format of logs you have? Can you post some sample events?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 18:54:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195782#M38946</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-27T18:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a numeric field at index-time (from microseconds to milliseconds)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195783#M38947</link>
      <description>&lt;P&gt;They are standard Apache logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;179.31.12.34 - - [26/Aug/2015:14:26:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 9565
179.31.12.34 - - [26/Aug/2015:14:31:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 22270
179.31.12.34 - - [26/Aug/2015:14:36:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 17775
179.31.12.34 - - [26/Aug/2015:14:41:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 19384
179.31.12.34 - - [26/Aug/2015:14:46:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 15199
179.31.12.34 - - [26/Aug/2015:14:51:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 13081
179.31.12.34 - - [26/Aug/2015:14:56:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 14866
179.31.12.34 - - [26/Aug/2015:15:01:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 14962
179.31.12.34 - - [26/Aug/2015:15:06:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 14313
179.31.12.34 - - [26/Aug/2015:15:11:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 18321
179.31.12.34 - - [26/Aug/2015:15:16:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 18693
179.31.12.34 - - [26/Aug/2015:15:21:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 15301
179.31.12.34 - - [26/Aug/2015:15:26:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 15142
179.31.12.34 - - [26/Aug/2015:15:31:04 -0400] "GET /AnApplication/ HTTP/1.1" 200 84 18524
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The last field being the request time in microseconds.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 20:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195783#M38947</guid>
      <dc:creator>splunkmasterfle</dc:creator>
      <dc:date>2015-08-27T20:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a numeric field at index-time (from microseconds to milliseconds)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195784#M38948</link>
      <description>&lt;P&gt;In the props.conf in that sourcetype stanza you can do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-request_seconds = request_time /1000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just replace the request_time with the field you already have being extracted for that number&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 21:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195784#M38948</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2015-08-27T21:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a numeric field at index-time (from microseconds to milliseconds)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195785#M38949</link>
      <description>&lt;P&gt;The answer from @diogofgm creates  a new field but this solution updates the &lt;CODE&gt;_raw&lt;/CODE&gt; event by putting this in &lt;CODE&gt;props.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceTypeHere]
SEDCMD-1digitTo2 =s/ \(.\)$/ 0\1/
SEDCMD-2digitsTo3 = s/ \(..\)$/ 0\1/
SEDCMD-micro2milli = s/ \(.*\)\(...\)$/ \1\.\2/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Aug 2015 00:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-transform-a-numeric-field-at-index-time-from-microseconds/m-p/195785#M38949</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-28T00:21:08Z</dc:date>
    </item>
  </channel>
</rss>

