<div dir="ltr">Hello Sebastian!<div><br></div><div>I see you have asked your question a month ago, but hope my answers can still help you.</div><div><br></div><div>Best Regards,</div><div>Gabor <br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 30, 2017 at 4:02 PM, Sebastian Roland <span dir="ltr"><<a href="mailto:seroland86@gmail.com" target="_blank">seroland86@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
after reading the admin guide and playing around with different setups<br>
several times I'm still struggling to fully understand the timezone<br>
functionality of syslog-ng.<br>
<br>
How are time-zone() / recv-time-zone() and send-time-zone() related?<br>
<br>
Some notes I made during investigation:<br>
<br>
* Logging through syslog() function logs in old BSD syslog format which<br>
does not contain a timezone. recv-time-zone() is utilized to assign a<br>
timezone. If no value has been specified the local time zone is used.</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
* According to the admin guide send-time-zone() is only used when the<br>
timezone is not specified otherwise. This didn't turned out to be true.<br>
<br>
Example:<br>
Syslog server a sends via syslog protocol over tcp (timezone is part of<br>
the message) to server b. setting send-time-zone(x) on server b changes<br>
the timezone (and timestamp) in the destination file to the time in<br>
timezone x.<br>
If send-time-zone() is not set at all nothing happens although the<br>
admin guide states that the default is to use the local timezone. IMHO<br>
no change should be applied to the message. Note that keep-<br>
timestamp(yes) is set on server b.<br></blockquote><div><font color="#990000">Only using the local timezone if no timezone info is found in the message.</font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
* If both time-zone() and send-time-zone() are set globally time-zone()<br>
overrides send-time-zone()<br></blockquote><div><span style="background-color:rgb(255,255,255)"><font color="#990000">Both time-zone() and send-time-zone() does the same in global settings (setting the timezone info for sent messages).</font></span></div><div><span style="background-color:rgb(255,255,255)"><font color="#990000">Therefore whichever comes later will be the actual sent timezone. </font></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
* time-zone() can be set globally and on drivers. Specific settings<br>
overrides global config.<br></blockquote><div><font color="#990000">I think this expected, isn't it? </font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
The confusing part is the behavior when a timestamp is already set<br>
within an incoming message and send-time-zone() is explicitly set (with<br>
keep-timestamp(yes)). Is it actually intended that send-time-zone()<br>
changes a timestamp?<br></blockquote><div><font color="#990000">No, it should not be changed if incoming message has timestamp and keep-timestamp(yes) is set.</font> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Shouldn't the logic be that recv-time-zone() and send-time-zone() are<br>
only relevant when there is no tz offset available and a default one<br>
needs to be set for receiving and sending respectively and time-zone()<br>
is used to actually convert to a different timezone?<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
If I'm getting something fundamentally wrong please advice.<br></blockquote><div><font color="#990000">To be able to investigate this in detail can you share your configuration, syslog-ng version, please?</font></div><div><font color="#990000">Also if you can share some examples of your incoming log files that would help a lot, because it can be a log parsing failure.</font></div><div><font color="#990000">You said that "Logging through syslog() function logs in old BSD syslog format </font><span style="color:rgb(153,0,0)">".</span></div><div><span style="color:rgb(153,0,0)">Well using syslog() driver requires sending the logs in RFC5424 format, but your can send old BSD syslog messages if they are framed in RFC5424.</span></div><div><span style="color:rgb(153,0,0)"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Kind regards<br>
Sebastian<br>
______________________________<wbr>______________________________<wbr>__________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/<wbr>mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/<wbr>support/documentation/?<wbr>product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/<wbr>syslog-ng-faq</a><br>
<br>
</blockquote></div><br></div></div></div>