Welcome! Log In Create A New Profile

Advanced

Re: Nginx only sends hostname to syslog.

Kai Stian Olstad
February 08, 2017 08:56AM
On 03.02.2017 13:58, Maxim Dounin wrote:
> Hello!
>
> On Fri, Feb 03, 2017 at 01:17:30PM +0100, Kai Stian Olstad wrote:
>
>> To get the post data from Kibana I use Nginx as a proxy and have the
>> following log format,
>>
>> log_format audit '$time_iso8601 "$remote_user" "$request_uri"
>> "$request_body"';
>>
>>
>> and to send the log to syslog I use the following.
>>
>> access_log syslog:server=192.168.1.1,tag=audit audit;
>>
>>
>> But Nginx only sends hostname to syslog server, is it possible to
>> configure Nginx to send fully qualified domain name?
>
> Much like for the $hostname variable, for syslog logging nginx
> uses whatever is returned by the gethostname() call. It's up to
> you to configure fully qualified domain name as a hostname of a
> particular server.

Thank you for the answer.

The challenge is that in Debian hostname should only be the name and not
the FQDN.
https://www.debian.org/doc/manuals/debian-reference/ch03.en.html#_the_hostname

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.

If it's not possible to configure this in Nginx I would need to find a
workaround.
One way could be to make Nginx log to file and rsyslog read that file.

Is that my only way?

--
Kai Stian Olstad
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Re: Nginx only sends hostname to syslog.

Kai Stian Olstad February 08, 2017 08:56AM

Re: Nginx only sends hostname to syslog.

Maxim Dounin February 08, 2017 08:56AM

Re: Nginx only sends hostname to syslog.

B.R. via nginx February 10, 2017 11:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 132
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready