Logstash 監(jiān)聽文件變動,并將內(nèi)容同步到elasticsearch

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)修改頻率。




最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容