<?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: Input files have changed format, so how do I edit my configurations to keep the old data and handle the new data? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Input-files-have-changed-format-so-how-do-I-edit-my/m-p/208718#M41119</link>
    <description>&lt;P&gt;You should just be able to add the two fields in transforms.conf without impacting existing events that don't contain data for those fields.&lt;BR /&gt;
To get default values assigned to those two fields for older events, you can setup two calculated fields for your sourcetype, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fieldname: user
eval: if(isNull( user, "defaultUser", user ))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do the same thing for your default id.&lt;/P&gt;

&lt;P&gt;BTW, I'd recommend picking a more descriptive name for your sourcetype. PSV describes the format, not so much the content. Maybe something like [ErrorMonitoring]. In most cases, that makes it easier for users having an idea what the data is that they are looking at. Just a thought. &lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2015 21:09:43 GMT</pubDate>
    <dc:creator>s2_splunk</dc:creator>
    <dc:date>2015-10-29T21:09:43Z</dc:date>
    <item>
      <title>Input files have changed format, so how do I edit my configurations to keep the old data and handle the new data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Input-files-have-changed-format-so-how-do-I-edit-my/m-p/208717#M41118</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Here is my situation (and I know it isn't ideal, but I have to work with it for now)&lt;/P&gt;

&lt;P&gt;I have scripts that pre-process log files to a standard format that Splunk digests. The format isn't really that important here, but the problem is that I have to add two more fields to this file that is created.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;How do I handle this change in the format of my input file with the setup that I currently have?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;I want the old data to remain unchanged and also perhaps add a default value for the 2 new fields ?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/error-monitoring]
followTail = 0
sourcetype = psv
host =
host_regex = ([^/.]+).
index = test-index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[psv]
REPORT-PSV = psv-delim
pulldown_type = 1
NO_BINARY_CHECK = 1
SHOULD_LINEMERGE = false
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[psv-delim]
DELIMS = "|"
FIELDS = server,service,date,type,requestId,class,message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;....&lt;/P&gt;

&lt;P&gt;So essentially my &lt;STRONG&gt;new&lt;/STRONG&gt; input file would have &lt;STRONG&gt;server,service,date,type,requestId,class,message,user,id&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Halp.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 20:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Input-files-have-changed-format-so-how-do-I-edit-my/m-p/208717#M41118</guid>
      <dc:creator>splunkmasterfle</dc:creator>
      <dc:date>2015-10-29T20:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Input files have changed format, so how do I edit my configurations to keep the old data and handle the new data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Input-files-have-changed-format-so-how-do-I-edit-my/m-p/208718#M41119</link>
      <description>&lt;P&gt;You should just be able to add the two fields in transforms.conf without impacting existing events that don't contain data for those fields.&lt;BR /&gt;
To get default values assigned to those two fields for older events, you can setup two calculated fields for your sourcetype, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fieldname: user
eval: if(isNull( user, "defaultUser", user ))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do the same thing for your default id.&lt;/P&gt;

&lt;P&gt;BTW, I'd recommend picking a more descriptive name for your sourcetype. PSV describes the format, not so much the content. Maybe something like [ErrorMonitoring]. In most cases, that makes it easier for users having an idea what the data is that they are looking at. Just a thought. &lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 21:09:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Input-files-have-changed-format-so-how-do-I-edit-my/m-p/208718#M41119</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2015-10-29T21:09:43Z</dc:date>
    </item>
  </channel>
</rss>

