[英]How to Use a Custom Ingest Pipeline with a Filebeat Module
如何使用带有 Filebeat 模块的自定义摄取管道? 就我而言,我使用的是apache
模块。
根据多个消息来源,这可以通过output.elasticsearch.pipeline
/ output.elasticsearch.pipelines[pipeline]
. 来源如下:
但是,在多次尝试不同排列之后,我始终无法影响 Filebeat 使用哪个摄取管道。 它总是使用模块的库存摄取管道。
这只是众多尝试之一:
filebeat.config:
filebeat.modules:
- module: apache
access:
enabled: true
var.paths: ["/var/log/apache2/custom_access*"]
error:
enabled: true
var.paths: ["/var/log/apache2/custom_error*"]
filebeat.config.modules:
reload.enabled: true
reload.period: 5s
output.elasticsearch:
hosts: ["${ELASTICSEARCH_URL}"]
pipeline: "apache_with_optional_x_forwarded_for"
使用调试 ( -d "*"
) 运行 filebeat 显示以下内容,我假设这表明我的规范已被忽略。 (我还可以通过 Elasticsearch 中的生成文档来判断我的自定义管道被回避了。)
2021-12-16T23:23:47.464Z DEBUG [processors] processing/processors.go:203 Publish event: {
"@timestamp": "2021-12-16T23:23:47.464Z",
"@metadata": {
"beat": "filebeat",
"type": "_doc",
"version": "7.10.2",
"pipeline": "filebeat-7.10.2-apache-access-pipeline"
},
我在 Filebeat v6.8 和 v7.10 中都试过这个(在 docker.elastic.co/beats/filebeat docker 图像中)。
这类似于这些线程,它们从未有过令人满意的结论:
好吧,根据 beats 存储库上的这个PR ,要覆盖模块管道,您需要在input
配置中指定自定义管道,而不是在output
上。
尝试这个:
filebeat.modules:
- module: apache
access:
enabled: true
input.pipeline: your-custom-pipeline
var.paths: ["/var/log/apache2/custom_access*"]
error:
enabled: true
input.pipeline: your-custom-pipeline
var.paths: ["/var/log/apache2/custom_error*"]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.