我有web服务器(Ubuntu)与Nginx + PHP。
它有File节拍,它直接将Nginx日志发送到弹性摄取节点(没有Logstash或其他任何东西)。
当我第一次安装它时,我对管道进行了一些自定义,Filebeat创建了这个管道。一个多月来一切都很顺利。
但是我注意到,每次File节拍升级都会导致新管道的创建。目前,我有以下几点:
filebeat-7.3.1-nginx-error-pipeline: {},
filebeat-7.4.1-nginx-error-pipeline: {},
filebeat-7.2.0-nginx-access-default: {},
filebeat-7.3.2-nginx-error-pipeline: {},
filebeat-7.4.1-nginx-access-default: {},
filebeat-7.3.1-nginx-access-default: {},
filebeat-7.3.2-nginx-access-default: {},
filebeat-7.2.0-nginx-error-pipeline: {}我可以创建新的管道,但是如何告诉(如何配置)File节拍来使用特定的管道?
以下是我尝试过的,但不起作用的东西:
- module: nginx
# Access logs
access:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/var/log/nginx/*/*access.log"]
# Convert the timestamp to UTC
var.convert_timezone: true
# The Ingest Node pipeline ID associated with this input. If this is set, it
# overwrites the pipeline option from the Elasticsearch output.
output.elasticsearch.pipeline: 'filebeat-nginx-access-default'
pipeline: 'filebeat-nginx-access-default它仍然使用filebeat-7.4.1-nginx-error-pipeline管道。
下面是关于如何配置它的文件节拍说明(但我无法使它工作):https://github.com/elastic/beats/blob/7.4/filebeat/filebeat.reference.yml#L1129-L1130
问题:如何将Filebeat模块配置为使用特定管道?
更新(2019年11月):我提交了相关的bug:https://github.com/elastic/beats/issues/14348
发布于 2019-11-11 11:23:14
在B拍源代码中,我发现管道ID由以下params解决:
源代码片段如下:
// formatPipelineID generates the ID to be used for the pipeline ID in Elasticsearch
func formatPipelineID(module, fileset, path, beatVersion string) string {
return fmt.Sprintf("filebeat-%s-%s-%s-%s", beatVersion, module, fileset, removeExt(filepath.Base(path)))
}因此,不能指定管道ID,这需要弹性的官方支持。
目前,管道ID与四个params一起更改。升级B拍时,必须更改elasticsearch中的管道ID。
发布于 2019-11-20 03:22:12
参考/{filebeat-HOME}/module/nginx/access/manifest.yml,也许您应该在/{filebeat-HOME}/modules.d/nginx.yml中设置ingest_pipeline。这个值看起来像一个本地文件。
发布于 2019-11-06 09:08:20
管道可以在input或output配置中配置,而不是在模块配置中配置。
因此,在您的配置中有不同的部分,您在问题中显示的部分是用于配置nginx模块。您需要打开filebeat.yml并查找已配置elasticsearch的output部分,并将管道配置放在那里:
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["elk.slavikf.com:9200"]
pipeline: filebeat-nginx-access-default如果您需要能够根据数据的性质使用不同的管道,那么使用管道映射绝对可以这样做。
output.elasticsearch:
hosts: ["elk.slavikf.com:9200"]
pipelines:
- pipeline: "nginx_pipeline"
when.contains:
type: "nginx"
- pipeline: "apache_pipeline"
when.contains:
type: "apache"https://stackoverflow.com/questions/58654560
复制相似问题