【发布时间】:2016-12-26 20:39:23
【问题描述】:
我运行了 service logstash configtest,但给出的错误是:
logstash:无法识别的服务
我能够单独运行 logstash 服务,但不能使用“configtest”。在 etc/logstash/conf.d/ 我创建了 logstash.conf 文件,其中包含如下代码:-
附加信息:-
service logstash status
● logstash.service - logstash
Loaded: loaded (/etc/systemd/system/logstash.service; disabled)
Active: active (running) since Mon 2016-12-26 12:40:58 PST; 6s ago
Main PID: 3512 (java)
CGroup: /system.slice/logstash.service
└─3512 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX...
Dec 26 12:40:58 Mr systemd[1]: Started logstash.
使用 configtest 运行时的服务:-
root@Mr:/# service logstash configtest
logstash: unrecognized service
我在 debian8 机器上运行这个,希望我能从你们那里得到一个好的解决方案。
# This input block will listen on port 10514 for logs to come in.
# host should be an IP on the Logstash server.
# codec => "json" indicates that we expect the lines we're receiving to be in JSON format
# type => "rsyslog" is an optional identifier to help identify messaging streams in the pipeline.
input {
udp {
host => "logstash_private_ip"
port => 10514
codec => "json"
type => "rsyslog"
}
}
# This is an empty filter block. You can later add other filters here to further process
# your log lines
filter { }
# This output block will send all events of type "rsyslog" to Elasticsearch at the configured
# host and port into daily indices of the pattern, "rsyslog-YYYY.MM.DD"
output {
if [type] == "rsyslog" {
elasticsearch {
hosts => [ "elasticsearch_private_ip:9200" ]
}
}
}
【问题讨论】:
标签: logstash logstash-configuration