Linux 如何集中rsyslogs并将其用作logstash的输入?

Linux 如何集中rsyslogs并将其用作logstash的输入?,linux,logging,logstash,rsyslog,Linux,Logging,Logstash,Rsyslog,我想从我的客户端服务器发送我的rsyslogs,并将它们用作我的日志库中的输入,这是我在web上找到的: 在我的客户端上,我在rsyslog.conf中添加了以下行: $ModLoad imuxsock $ModLoad imklog # Provides UDP forwarding. The IP is the server's IP address *.* @192.168.1.1:5040 # Provides TCP forwarding. But the current se

我想从我的客户端服务器发送我的rsyslogs,并将它们用作我的日志库中的输入,这是我在web上找到的:

在我的客户端上,我在rsyslog.conf中添加了以下行:

$ModLoad imuxsock

$ModLoad imklog

# Provides UDP forwarding. The IP is the server's IP address
*.* @192.168.1.1:5040 

# Provides TCP forwarding. But the current server runs on UDP
# *.* @@192.168.1.1:5040
并将以下行添加到我的服务器:

# provides support for local system logging
$ModLoad imuxsock 

# provides kernel logging support (previously done by rklogd)
$ModLoad imklog

# provides UDP syslog reception. For TCP, load imtcp.
$ModLoad imudp

# For TCP, InputServerRun 514
$UDPServerRun 514

# This one is the template to generate the log filename dynamically, depending on the client's IP address.
$template FILENAME,"/var/log/%fromhost-ip%/syslog.log"

# Log all messages to the dynamically formed file. Now each clients log (192.168.1.2, 192.168.1.3,etc...), will be under a separate directory which is formed by the template FILENAME.
*.* ?FILENAME
并在客户端和服务器上重新启动rsyslog,然后在我的日志库中,我这样描述了我的输入:

input {
  tcp {
     port => 5040
     type => syslog
   }
   udp {
     port => 5040
     type => syslog
   }
}
但它什么也不做,当我执行control+C时,它会显示以下错误:

SIGINT received. Shutting down the pipeline. {:level=>:warn}
UDP listener died {:exception=>#<IOError: closed stream>, :backtrace=>["org/jruby/RubyIO.java:3682:in `select'", " ...
这是我日志的输出部分:

output {
  stdout { }
  solr_http {
    solr_url => "http://localhost:8983/solr/logstash_logs"
  }

}

我该怎么做才能修复它?

问题是因为我的防火墙和iptables!在我禁用它们之后,一切都正常工作

systemctl disable firewalld.service
systemctl disable iptables.service

我无法回答问题的syslog方面,但是没有输出{}节的logstash配置将符合“不做任何事情”的条件。你有一个stdout{}输出节,可以显示logstash看到了什么吗?@AlainCollins是的,我在logstash的输出部分有stdout,但没有显示任何内容。我编辑了我的帖子并添加了输出部分。如果stdout{}确实没有显示任何内容,那么logstash就没有任何输入。@AlainCollins没错,是因为我的防火墙!
systemctl disable firewalld.service
systemctl disable iptables.service