<?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 Setting Timezone based on hostname extracted with regex in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51096#M9800</link>
    <description>&lt;P&gt;I have to upload data from different sources (collected manually) and upload to a splunk indexer. The files are copied to the server with corresponding details &amp;amp; timezone (such as US_Pacific etc) in the path.&lt;/P&gt;

&lt;P&gt;'host' field is extracted thru host_regex in my inputs.conf file, and part of it is the timezone.
e.g. hostname could abc\tz_US_Pacific or xyz\tz_US_Eastern. (the abc and xyz relate to some other fields).&lt;/P&gt;

&lt;P&gt;I'm trying to set the TZ using the props.conf as follows:&lt;/P&gt;

&lt;P&gt;[host::*tz_US_Pacific]
TZ = US/Pacific&lt;/P&gt;

&lt;P&gt;[mysourcetype]
EXTRACT-...&lt;/P&gt;

&lt;P&gt;The Timezone offset is never applied (I have more hosts with Eastern time etc.) and all the logs are indexed with TZ as the local timezone for the Splunk server (which is IST).&lt;/P&gt;

&lt;P&gt;Am I missing something here? Do I have to change the order of setting Timezone?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Sep 2010 22:31:37 GMT</pubDate>
    <dc:creator>Krishna_R</dc:creator>
    <dc:date>2010-09-15T22:31:37Z</dc:date>
    <item>
      <title>Setting Timezone based on hostname extracted with regex</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51096#M9800</link>
      <description>&lt;P&gt;I have to upload data from different sources (collected manually) and upload to a splunk indexer. The files are copied to the server with corresponding details &amp;amp; timezone (such as US_Pacific etc) in the path.&lt;/P&gt;

&lt;P&gt;'host' field is extracted thru host_regex in my inputs.conf file, and part of it is the timezone.
e.g. hostname could abc\tz_US_Pacific or xyz\tz_US_Eastern. (the abc and xyz relate to some other fields).&lt;/P&gt;

&lt;P&gt;I'm trying to set the TZ using the props.conf as follows:&lt;/P&gt;

&lt;P&gt;[host::*tz_US_Pacific]
TZ = US/Pacific&lt;/P&gt;

&lt;P&gt;[mysourcetype]
EXTRACT-...&lt;/P&gt;

&lt;P&gt;The Timezone offset is never applied (I have more hosts with Eastern time etc.) and all the logs are indexed with TZ as the local timezone for the Splunk server (which is IST).&lt;/P&gt;

&lt;P&gt;Am I missing something here? Do I have to change the order of setting Timezone?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2010 22:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51096#M9800</guid>
      <dc:creator>Krishna_R</dc:creator>
      <dc:date>2010-09-15T22:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Timezone based on hostname extracted with regex</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51097#M9801</link>
      <description>&lt;P&gt;Unfortunately it is not possible to configure a host extraction then a timezone based on the host extraction.  A suggested workaround is to change the logging convention to write the files to directories by host then apply timezone settings by source.&lt;/P&gt;

&lt;P&gt;There is a similar discussion with additional details here: &lt;A href="http://answers.splunk.com/questions/804/how-to-set-timezone-in-an-advanced-configuration" rel="nofollow"&gt;How to Set Timezone in an Advanced Configuration?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2010 23:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51097#M9801</guid>
      <dc:creator>hulahoop</dc:creator>
      <dc:date>2010-09-15T23:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Timezone based on hostname extracted with regex</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51098#M9802</link>
      <description>&lt;P&gt;Thanks for the quick response. Do you mean to use the source path to set the TZ offset?&lt;BR /&gt;
I already extract the sourcetype from another part of the path (the path is quite long thanks to all the metadata fields in the path).&lt;BR /&gt;
So, I already have &lt;BR /&gt;
[source::...\mysourcetype\...?] &lt;BR /&gt;
sourcetype = mysourcetype &lt;BR /&gt;
as a stanza in props.conf. If I add one more as below, would both of them be applied for the same source file or only one of them?&lt;BR /&gt;
[source::...\tz_US_Pacific\...] &lt;BR /&gt;
TZ = US/Pacific&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51098#M9802</guid>
      <dc:creator>Krishna_R</dc:creator>
      <dc:date>2020-09-28T09:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Timezone based on hostname extracted with regex</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51099#M9803</link>
      <description>&lt;P&gt;I was able to accomplish it by using the source field.. Using 2 different stanzas, 1 for sourcetype and another for TZ works fine.&lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2010 00:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51099#M9803</guid>
      <dc:creator>Krishna_R</dc:creator>
      <dc:date>2010-09-17T00:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Timezone based on hostname extracted with regex</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51100#M9804</link>
      <description>&lt;P&gt;Awesome, glad it worked out.  I wish we could just make it possible to set TZ on extracted sourcetypes.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2010 00:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51100#M9804</guid>
      <dc:creator>hulahoop</dc:creator>
      <dc:date>2010-09-17T00:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Timezone based on hostname extracted with regex</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51101#M9805</link>
      <description>&lt;P&gt;Agreed 100%.. I'm adding many stanzas each for different TZ...&lt;/P&gt;</description>
      <pubDate>Sun, 10 Oct 2010 14:30:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51101#M9805</guid>
      <dc:creator>Krishna_R</dc:creator>
      <dc:date>2010-10-10T14:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Timezone based on hostname extracted with regex</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51102#M9806</link>
      <description>&lt;P&gt;This was my exact issue, I had rsyslog feeding 1 log from many servers. I changed rsyslog.conf to be:&lt;BR /&gt;
$template DynaFile,"/var/log/file-%programname%.log"&lt;BR /&gt;
local3.* -?DynaFile&lt;/P&gt;

&lt;P&gt;I was then able to create source type stanzas to use TZ= for timezone and host field renaming via transforms.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 17:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Timezone-based-on-hostname-extracted-with-regex/m-p/51102#M9806</guid>
      <dc:creator>BP9906</dc:creator>
      <dc:date>2014-05-30T17:49:47Z</dc:date>
    </item>
  </channel>
</rss>

