<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Correct me if I am wrong, since I probably will.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">From <a href="https://www.gnu.org/software/libc/manual/html_node/Host-Identification.html">what I read</a>, 'host name' aka name of the host is a FQDN in the <span style="font-family:monospace,monospace">hostname.domain</span> format (<span style="font-family:monospace,monospace">domain</span> being able to have n level-s).<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Thus, it seems that setting a FQDN as hostname is wrong, since <a href="http://serverfault.com/questions/490825/how-to-set-the-domain-name-on-gnu-linux">resolving the FQDN needs querying <span style="font-family:monospace,monospace">hostname</span> against <span style="font-family:monospace,monospace">hosts</span></a>.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">I am not quite sure that the standard then allow you to set more than 1 level in the hostname file.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Since nginx is using the hostname when sending logs to syslog, it does not seem you can get the FQDN through the standard settings. I could not find any variable containing the FQDN in the docs either.<br></div><div class="gmail_extra"><br><div style="font-size:small;color:rgb(51,51,153)" class="gmail_default">​Maybe someone w/ greater knowledge could give us a hand here.​</div><div><div class="gmail_signature" data-smartmail="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Tue, Feb 7, 2017 at 11:37 AM, Kai Stian Olstad <span dir="ltr"><<a href="mailto:nginx+list@olstad.com" target="_blank">nginx+list@olstad.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03.02.2017 13:58, Maxim Dounin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<br>
On Fri, Feb 03, 2017 at 01:17:30PM +0100, Kai Stian Olstad wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To get the post data from Kibana I use Nginx as a proxy and have the<br>
following log format,<br>
<br>
   log_format audit '$time_iso8601 "$remote_user" "$request_uri"<br>
"$request_body"';<br>
<br>
<br>
and to send the log to syslog I use the following.<br>
<br>
   access_log syslog:server=192.168.1.1,tag=<wbr>audit audit;<br>
<br>
<br>
But Nginx only sends hostname to syslog server, is it possible to<br>
configure Nginx to send fully qualified domain name?<br>
</blockquote>
<br>
Much like for the $hostname variable, for syslog logging nginx<br>
uses whatever is returned by the gethostname() call.  It's up to<br>
you to configure fully qualified domain name as a hostname of a<br>
particular server.<br>
</blockquote>
<br>
Thank you for the answer.<br>
<br>
The challenge is that in Debian hostname should only be the name and not the FQDN.<br>
<a href="https://www.debian.org/doc/manuals/debian-reference/ch03.en.html#_the_hostname" rel="noreferrer" target="_blank">https://www.debian.org/doc/man<wbr>uals/debian-reference/ch03.en.<wbr>html#_the_hostname</a><br>
<br>
When I set the hostname to FQDN, Nginx do log with the FQDN, but this break other things that relay on hostname only be name and not FQDN.<br>
<br>
If it's not possible to configure this in Nginx I would need to find a workaround.<br>
One way could be to make Nginx log to file and rsyslog read that file.<br>
<br>
Is that my only way?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Kai Stian Olstad<br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a><br>
</font></span></blockquote></div><br></div></div>