
1.在logstash里面添加如下配置:
input {
beats {
port => "5044"
}
}
---------------------------------------------------------------
# filter是要添加的部分
filter {
if "beats_input_codec_json_applied" in [tags] {
mutate {
remove_tag => ["beats_input_codec_json_applied"]
}
}
}
---------------------------------------------------------------
output {
if "php" in [tags] {
elasticsearch {
hosts => ["localhost"]
index => "logstash-php-errors-yqjbs-test-44-%{+YYYY.MM.dd}"
}
}
}
重启logstash 服务启动后进行测试

结果:

本文详细描述了如何在Logstash中配置Beats输入模块,针对beats输入的JSON数据进行处理,移除特定标签,并根据tags决定将数据发送至Elasticsearch,专用于PHP错误日志的索引。
5192

被折叠的 条评论
为什么被折叠?



