Welcome! Log In Create A New Profile

Advanced

Re: Nginx sends syslog messages with the name of the server - I would like the ip

Jeffrey 'jf' Lim
December 11, 2022 03:32AM
On Sun, Dec 11, 2022 at 8:03 AM Mik J via nginx <nginx@nginx.org> wrote:
>
> Hello,
>
> My Nginx server sends syslogs to my remote syslog server with a host = myserver.mydomain.org
> However I would like that the host to be the IP a specific IP of the server (which exists)
>
> On my Nginx server
> server {
> ...
> access_log syslog:server=1.2.3.4;
> error_log syslog:server=1.2.3.4;
>
> Is it possible that the syslog hostname in the message is set to 4.5.6.7 (the IP address of the Nginx server) ?
>

you can define a custom log_format
(http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format)
and then log using that format

-jf

--
He who settles on the idea of the intelligent man as a static entity
only shows himself to be a fool.
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

Nginx sends syslog messages with the name of the server - I would like the ip

Mik J via nginx December 10, 2022 07:04PM

Re: Nginx sends syslog messages with the name of the server - I would like the ip

Jeffrey 'jf' Lim December 11, 2022 03:32AM

Re: Nginx sends syslog messages with the name of the server - I would like the ip

Mik J via nginx December 11, 2022 04:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 153
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