logstash.yml 文件添加:
?xpack.monitoring.elasticsearch.url: "http://192.168.198.223:9200"
?xpack.monitoring.elasticsearch.username: "logstash_system"
?xpack.monitoring.elasticsearch.password: "changeme"
Logstash 安裝x-pack 插件:
logstash-plugin install file://E:/tmp/x-pack-5.2.2.zip ? # (windows)
or
logstash-plugin install file:///tmp/x-pack-5.2.2.zip? # (centos)
配置文件 test.conf:
input{
? ? file{
? ? ? ? path => ["E:\temp\nginx-1.11.3\nginx-1.11.3\logs\access.log"]
? ? ?}
beats{
? ? ?port => 5044
}
}
output{
? ? elasticsearch{
? ? user => "elastic"
? ? password => "elasticpassword"
? ? ? ? hosts => ["192.168.198.223:9200"]
? ? index => "message-%{+YYYY-MM}"
? ? ?}stdout{
? ? ? ? ? ? ? codec=>rubydebug
? ? ? }
}
可以通過kibana 查看相關(guān)內(nèi)容,并監(jiān)測相關(guān)修改頻率。


