无法让 FileBeat 发布到 Elastic Search

     2023-03-22     83

关键词:

【中文标题】无法让 FileBeat 发布到 Elastic Search【英文标题】:Cannot get FileBeat to post to Elastic Search 【发布时间】:2019-01-01 12:23:46 【问题描述】:

我有一个 kuberenetes 集群,我正在尝试从集群中的容器收集日志。我正在使用 Filebeat 收集日志并将其发送到弹性搜索,然后在 Kibana 中显示。我部署了 Kibana 和弹性搜索,它运行良好。我正在使用 DaemonSet 来部署 FileBeat。 这是我用来部署 Filebeat 的 YAML 文件。 我使用这里的清单文件来部署它并对其进行了一些修改。

https://www.elastic.co/guide/en/beats/filebeat/master/running-on-kubernetes.html

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  namespace: kube-system
  labels:
    k8s-app: filebeat
data:
  filebeat.yml: |-
    filebeat.config:
      inputs:
      - type: log
        # Mounted `filebeat-inputs` configmap:
        paths: /var/lib/docker/containers/*/*.log
        # Reload inputs configs as they change:
        reload.enabled: false
        json.message_key: log
        json.keys_under_root: true
    output.elasticsearch:
      hosts: ['x.x.x.x:9200']
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-inputs
  namespace: kube-system
  labels:
    k8s-app: filebeat
data:
  kubernetes.yml: |-
    - type: docker
      containers.ids:
      - "*"
      processors:
        - add_kubernetes_metadata:
            in_cluster: true
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: filebeat
  namespace: kube-system
  labels:
    k8s-app: filebeat
spec:
  template:
    metadata:
      labels:
        k8s-app: filebeat
    spec:
      serviceAccountName: filebeat
      terminationGracePeriodSeconds: 30
      containers:
      - name: filebeat
        image: docker.elastic.co/beats/filebeat:6.3.1
        args: [
          "-c", "/etc/filebeat.yml",
          "-e",
        ]
        env:
        - name: ELASTICSEARCH_HOST
          value: X.x.x.x
        - name: ELASTICSEARCH_PORT
          value: "9200"
          value:
        securityContext:
          runAsUser: 0
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 100Mi
        volumeMounts:
        - name: config
          mountPath: /etc/filebeat.yml
          readOnly: true
          subPath: filebeat.yml
        - name: inputs
          mountPath: /usr/share/filebeat/inputs.d
          readOnly: true
        - name: data
          mountPath: /usr/share/filebeat/data
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
      volumes:
      - name: config
        configMap:
          defaultMode: 0600
          name: filebeat-config
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: inputs
        configMap:
          defaultMode: 0600
          name: filebeat-inputs
      # data folder stores a registry of read status for all files, so we don't send everything again on a Filebeat pod restart
      - name: data
        hostPath:
          path: /var/lib/filebeat-data
          type: DirectoryOrCreate
--- 

我检查了运行 Filebeat 的 pod,它存储了日志。但不知何故,它不会将其发布到弹性搜索。我的确切配置应该是什么才能将其发布到elasticsearch。我已经坚持了几天了,我没有选择。任何帮助将不胜感激。

【问题讨论】:

【参考方案1】:

您的 filebeat 配置未选择任何输入类型。

filebeat.yaml 文件输入路径必须指向您的 filebeats-inputs.yaml 而不是日志位置。这反过来又委托给 docker 输入类型。默认的 containers.path 是 /var/lib/docker/containers。

https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-docker.html

【讨论】:

无法让烧瓶登录到 Elastic Beanstalk AWS 上的 opt/python/log

】无法让烧瓶登录到ElasticBeanstalkAWS上的opt/python/log【英文标题】:Can\'tgetflasktologtoopt/python/logonElasticBeanstalkAWS【发布时间】:2019-02-2304:44:39【问题描述】:我一直在尝试让我的Flask应用程序记录到日志文件。在弹性豆茎中,我的... 查看详情

Filebeat 容器不向 Elastic 发送日志

】Filebeat容器不向Elastic发送日志【英文标题】:FilebeatcontainerdoesnotsendlogstoElastic【发布时间】:2020-01-0421:09:35【问题描述】:在通过Windows10上的“Windows子系统Linux2”运行Ubuntu18.04的本地计算机上,我正在运行Elastic7.3、Kibana7.3和Ela... 查看详情

在 ELK 堆栈中调试 Filebeat

】在ELK堆栈中调试Filebeat【英文标题】:DebuggingFilebeatintheELKstack【发布时间】:2018-04-1420:22:56【问题描述】:我的ELK系统出现了一些问题。客户端工作如下:Filebeat->Logstash-->Elastic-->Kibana我们的部分日志不会从特定机器到达... 查看详情

无法让 https 在 Elastic Load Balancer (AWS) 上工作

】无法让https在ElasticLoadBalancer(AWS)上工作【英文标题】:Can\'tgethttpsworkingonElasticLoadBalancer(AWS)【发布时间】:2015-04-1401:09:11【问题描述】:我在ec2-Classic实例的前面有一个负载均衡器。我已通过直接链接到我的负载均衡器的“描述... 查看详情

elk—filebeat简介

Filebeat简介 轻量级的日志传输工具,是一个日志文件托运工具,在你的服务器上安装客户端后,filebeat会监控日志目录或者指定的日志文件,追踪读取这些文件(追踪文件的变化,不停的读),并且转发这些信息到elasticsearch... 查看详情

centos安装filebeat(代码片段)

先贴一下官方文档https://www.elastic.co/guide/en/beats/filebeat/6.6/filebeat-installation.html我本次使用rpm的方式安装,与官方文档略有差异,记录如下: //官方是使用curl命令:curl-L-Ohttps://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.6.1-x86_64.rpm//... 查看详情

filebeat到kafka日志无法传输

阿里云服务器现象1:查看filebeat日志[[email protected] bin]$ tail -n 20 /var/log/filebeat/filebeat2017-03-01T14:52:25+08:00WARNproducer/broker/0statechangeto[closing]becausedialtcp:loo 查看详情

elastic:总结收集日志的几种方法(代码片段)

...。在今天的这篇文章中,我来简单里回顾一下。通过Filebeat采集Filebeat是最为常用的一种采集日志的方法。使用Filebeat,我们也有如下的几种方法:通过模块进行采集为了能够使用Filebeat更加方便地 查看详情

elastic:总结收集日志的几种方法(代码片段)

...。在今天的这篇文章中,我来简单里回顾一下。通过Filebeat采集Filebeat是最为常用的一种采集日志的方法。使用Filebeat,我们也有如下的几种方法:通过模块进行采集为了能够使用Filebeat更加方便地 查看详情

filebeat、logstash过滤器实例

参考技术A主要描述filebeat和logstash的过滤器使用。参考:  filebeat:  https://www.elastic.co/guide/en/beats/filebeat/6.8/defining-processors.html  logstash:  https://www.elastic.co/guide/en/logstash/6.8/filter-plugins.html版本:elastics... 查看详情

filebeat中文指南

Filebeat中文指南翻译自:https://www.elastic.co/guide/en/beats/filebeat/current/index.html译者:kerwin鸣谢:torychuck一、概述Filebeat是一个日志文件托运工具,在你的服务器上安装客户端后,filebeat会监控日志目录或者指定的任职文件,追踪读取... 查看详情

windows下elk安装配置-elasticsearch/kibana/filebeat(代码片段)

...tps://artifacts.elastic.co/downloads/kibana/kibana-8.6.2-windows-x86_64.zipfilebeat:https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.6.2-windows-x86_64.zip分别解压至D:\\Deploy\\Elastic\\search\\8.6.2\\D:\\Deploy\\Elastic\\kibana\\8.6.2\\D:\\Deploy\\Elastic\\filebeat\\8.6.2\\&n... 查看详情

filebeat中文指南

翻译自:https://www.elastic.co/guide/en/beats/filebeat/current/index.htmlpowerby kerwin一、概述Filebeat是一个日志文件托运工具,在你的服务器上安装客户端后,filebeat会监控日志目录或者指定的日志文件,追踪读取这些文件(追踪文件的变... 查看详情

filebeat收集syslog并自动归类

...就是需要安装一个又一个的ruby插件,不便于部署。发现filebeat越来越成熟,支持的input协议和output协议很多,也不需要安装额外的插件。本文介绍使用filebeat收集远程Linux和思科网络设备的syslog,并根据需求写入到elasticsearch的不... 查看详情

结合springboot搭建日志采集系统efk

参考技术AEFK架构(elasticsearchfilebeatkibana)1、filebeat采集日志(可以采集多种日志类型loghttpsystemcpmqdockeraws...,具体采集配置参照:https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html)2、filebeat将采集到的日志解... 查看详情

无法通过 Eclipse 部署到 Elastic Beanstalk

】无法通过Eclipse部署到ElasticBeanstalk【英文标题】:UnabletodeploytoElasticBeanstalkviaEclipse【发布时间】:2011-12-2820:07:36【问题描述】:我使用AWS插件运行Eclipse。而且我新建了一个简单的web应用,可以在本地成功运行。但是当我尝试在... 查看详情

无法将 RDS 实例添加到 Elastic Beanstalk

】无法将RDS实例添加到ElasticBeanstalk【英文标题】:UnabletoaddanRDSinstancetoElasticBeanstalk【发布时间】:2018-02-2311:18:35【问题描述】:突然我无法将RDS添加到我的EB环境中,不知道为什么。以下是完整的错误信息:无法检索RDS配置选项... 查看详情

安装filebeat+elasticsearch+kibana(单节点)

参考技术Ahttps://www.elastic.co/cn/support/matrix#matrix_compatibilityhttps://www.elastic.co/guide/en/elastic-stack-get-started/7.16/get-started-elastic-stack.htmlhttps://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-security.htmlhttps://blog.csdn.net/fjxcsdn/article/detail... 查看详情