How can I set syslog send message to multinode syslog tcp input?

Hi all,
I installed graylog cluster with six nodes. Then I create global “Syslog TCP” in graylog (port is 5140). I use 192.168.93.133 nginx server to proxy these six nodes, but when I config syslog with 192.168.93.133:15140, graylog did not receive any data. When I config syslog with 192.168.93.127:5140, graylog can receive data. Why didn’t nginx relay messages?
Please help me!
this is nginx.conf on 192.168.93.133:

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}
stream {
        proxy_protocol_timeout 120s;
        log_format  main  '$remote_addr $remote_port - [$time_local] '
                          '$status $bytes_sent $protocol $server_addr $server_port'
                          '$proxy_protocol_addr $proxy_protocol_port';
        access_log /var/log/nginx/access.log main;

        upstream 5140_tcp_upstreams {
                server 192.168.93.127:5140;
                server 192.168.93.128:5140;
                server 192.168.93.129:5140;
                server 192.168.93.130:5140;
                server 192.168.93.131:5140;
                server 192.168.93.132:5140;
        }

        server {
                listen 15140;
                proxy_pass 5140_tcp_upstreams;
                #proxy_timeout 1s;
                proxy_connect_timeout 5s;
        }
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

please clarify:

  • how did you configure the input exactly?
  • did you checked the rsyslog and graylog logfiles?

you might want to read: https://thehftguy.com/2016/10/03/haproxy-vs-nginx-why-you-should-never-use-nginx-for-load-balancing/

This is input:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.