<?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 How to apply a timezone (TZ) props.conf entry to a rewritten source or host? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-a-timezone-TZ-props-conf-entry-to-a-rewritten/m-p/157331#M31898</link>
    <description>&lt;P&gt;I have a datasource which includes a timestamp without a timezone forwarded from a single collection source, and some other location data in the event which I can use to categorise the data into their respective timezones.&lt;/P&gt;

&lt;P&gt;As the data is forwarded from a single source, I cannot set the timezones at input.confs without a script to pre-process the data, which I would like to avoid. The output format of the data is fixed and I have no access to the source.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Source: foo&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;Sourcetype: bar&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;Event: AAA,foobar,AUVI,201412121738,324521345,3452345,IVXIJB1,3,0,1,2346,357,8&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So we have the following props and transforms:&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
&lt;CODE&gt;[bar]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;SHOULD_LINEMERGE = false&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TIME_PREFIX = (?:[^,]*,){3}&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TIME_FORMAT = %Y%m%d%H%M&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TRANSFORMS-bar_create_host = bar_create_host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUVI*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Melbourne&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUNS*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Sydney&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUQL*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Brisbane&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUSA*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Adelaide&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
&lt;CODE&gt;[bar_create_host]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;SOURCE_KEY = _raw&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = (?^AAA),(?[a-zA-Z0-9]*),(?[A-Z0-9]*)&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = $3&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = MetaData:Host&lt;/CODE&gt;`&lt;/P&gt;

&lt;P&gt;The host gets rewritten fine, the timestamp extracts fine, but the timezone will not apply based on the rewritten host stanza in props.conf. the date_zone field is always 'local' (should be 600 if set to Australia/Melbourne / UTC+10:00)&lt;/P&gt;

&lt;P&gt;I have tried rewriting the source instead of the host field and setting the TZ entry under a &lt;CODE&gt;source::foo&lt;/CODE&gt; based stanza in props.conf, I have tried setting priority of the associated props stanzas to 1 and 100 in alternating configs to no avail.&lt;/P&gt;

&lt;P&gt;At the moment I'm stuck on using a heavy forwarder to do the host rewrite then forcing the input of the cooked data to be reparsed at the indexer so the TZ entry is honoured on a per-host or per-source basis. That is really more cumbersome than I would like.&lt;/P&gt;

&lt;P&gt;Is this a bug or is the parsing of these events working as designed, that is you cannot set the TZ at index/parsing time by a rewritten host or source stanza?&lt;/P&gt;

&lt;P&gt;Any assistance appreciated. I would like to avoid a scripted input if possible.&lt;/P&gt;

&lt;P&gt;This is in a distributed install on RHEL/OEL 5 &amp;amp; 6 x64, Splunk version 6.1.5 on forwarders, indexers and search heads.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Dec 2014 07:07:24 GMT</pubDate>
    <dc:creator>eddit0r</dc:creator>
    <dc:date>2014-12-12T07:07:24Z</dc:date>
    <item>
      <title>How to apply a timezone (TZ) props.conf entry to a rewritten source or host?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-a-timezone-TZ-props-conf-entry-to-a-rewritten/m-p/157331#M31898</link>
      <description>&lt;P&gt;I have a datasource which includes a timestamp without a timezone forwarded from a single collection source, and some other location data in the event which I can use to categorise the data into their respective timezones.&lt;/P&gt;

&lt;P&gt;As the data is forwarded from a single source, I cannot set the timezones at input.confs without a script to pre-process the data, which I would like to avoid. The output format of the data is fixed and I have no access to the source.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Source: foo&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;Sourcetype: bar&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;Event: AAA,foobar,AUVI,201412121738,324521345,3452345,IVXIJB1,3,0,1,2346,357,8&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So we have the following props and transforms:&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
&lt;CODE&gt;[bar]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;SHOULD_LINEMERGE = false&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TIME_PREFIX = (?:[^,]*,){3}&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TIME_FORMAT = %Y%m%d%H%M&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TRANSFORMS-bar_create_host = bar_create_host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUVI*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Melbourne&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUNS*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Sydney&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUQL*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Brisbane&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host::AUSA*]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ = Australia/Adelaide&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
&lt;CODE&gt;[bar_create_host]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;SOURCE_KEY = _raw&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = (?^AAA),(?[a-zA-Z0-9]*),(?[A-Z0-9]*)&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = $3&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = MetaData:Host&lt;/CODE&gt;`&lt;/P&gt;

&lt;P&gt;The host gets rewritten fine, the timestamp extracts fine, but the timezone will not apply based on the rewritten host stanza in props.conf. the date_zone field is always 'local' (should be 600 if set to Australia/Melbourne / UTC+10:00)&lt;/P&gt;

&lt;P&gt;I have tried rewriting the source instead of the host field and setting the TZ entry under a &lt;CODE&gt;source::foo&lt;/CODE&gt; based stanza in props.conf, I have tried setting priority of the associated props stanzas to 1 and 100 in alternating configs to no avail.&lt;/P&gt;

&lt;P&gt;At the moment I'm stuck on using a heavy forwarder to do the host rewrite then forcing the input of the cooked data to be reparsed at the indexer so the TZ entry is honoured on a per-host or per-source basis. That is really more cumbersome than I would like.&lt;/P&gt;

&lt;P&gt;Is this a bug or is the parsing of these events working as designed, that is you cannot set the TZ at index/parsing time by a rewritten host or source stanza?&lt;/P&gt;

&lt;P&gt;Any assistance appreciated. I would like to avoid a scripted input if possible.&lt;/P&gt;

&lt;P&gt;This is in a distributed install on RHEL/OEL 5 &amp;amp; 6 x64, Splunk version 6.1.5 on forwarders, indexers and search heads.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2014 07:07:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-a-timezone-TZ-props-conf-entry-to-a-rewritten/m-p/157331#M31898</guid>
      <dc:creator>eddit0r</dc:creator>
      <dc:date>2014-12-12T07:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a timezone (TZ) props.conf entry to a rewritten source or host?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-a-timezone-TZ-props-conf-entry-to-a-rewritten/m-p/157332#M31899</link>
      <description>&lt;P&gt;As you noted, the problem is that you have overridden your &lt;CODE&gt;host&lt;/CODE&gt; and you cannot use the new &lt;CODE&gt;host&lt;/CODE&gt; value as a stanza header in &lt;CODE&gt;props.conf&lt;/CODE&gt;; therefore, you need to trigger off of &lt;CODE&gt;source&lt;/CODE&gt; or &lt;CODE&gt;sourcetype&lt;/CODE&gt; and you may have more options than you suppose.  The easiest option is to write your files into a directory that directly (/mydir/TZ-Central/) or indirectly (/mydir/hostx/) identifies something that you can use later with a &lt;CODE&gt;source&lt;/CODE&gt;-based stanza header like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/mydir/TZ-Central/*]
TZ=US/Central
[source::/mydir/hostx/*]
TZ=US/Eastern
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jun 2015 04:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-a-timezone-TZ-props-conf-entry-to-a-rewritten/m-p/157332#M31899</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-29T04:01:40Z</dc:date>
    </item>
  </channel>
</rss>

