Nginx sends syslog messages with the name of the server - I would like the ip
Mik J
mikydevel at yahoo.fr
Sun Dec 11 09:16:54 UTC 2022
Thannk you Jeffrey for your help
Le dimanche 11 décembre 2022 à 09:31:10 UTC+1, Jeffrey 'jf' Lim <jfs.world at gmail.com> a écrit :
On Sun, Dec 11, 2022 at 8:03 AM Mik J via nginx <nginx at 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.
More information about the nginx
mailing list