filebeat自定义pipeline名字(module的pipeline无法自定义名字)

  • 参考:stackflow上的解释
  • filebeat 版本 : 7.4.2
  • elasticsearch 版本: 7.4.2
  • Kibana 7.4.2
  • 在自定义filebeat的nginx module的pipeline名字的时候,一直失败,也找不到解决方案,最后看了一下github上的issue,才发现原来filebeat的module的pipeline名字无法自定义。。。在这里记录一下替代方案。

filebeats的module的pipeline的名字是由程序生成的,无法自定义,而且覆盖pipeline的name这个操作貌似也是行不通的。

// 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)))
}

因此如果要自定义pipeline的名字,只能通过在配置文件配置inputs,实现自定义的日志输入。


下面以nginx为例

  • filebeat.yml
    filebeat.overwrite_pipelines: true
    filebeat.inputs:
        - type: log
          enabled: true
          paths:
            - D:\\nginx-1.16.0\\logs\\access*.log
          pipeline: huawei-nginx-access
    
  • huawei-nginx-access这个pipeline则可以使用kibana的dev工具,采用PUT请求更新创建,并使用GET查看是否创建成功。
PUT _ingest/pipeline/huawei-nginx-access
{boby}

GET _ingest/pipeline/huawei-nginx-access

在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值