Beats 推出基于提示的 Docker 和 Kubernetes 自动发现 | Elastic Blog
工程

Beats 推出基于提示的 Docker 和 Kubernetes 自动发现

6.0 Beats Filebeat Metricbeat Docker KubernetesBeats

使

IP

Beats autodiscover schematics

metricbeat.autodiscover:
  providers:
   - type: docker
     templates:
       - condition.contains:
           docker.container.image: etcd
         config:
          - module: etcd
            metricsets: ["leader", "self", "store"]
            hosts: "${data.host}:2379"

output.elasticsearch:
  hosts: [“localhost:9200”]

Metricbeat 使 docker 使 etcd 使 contains: etcd Metricbeat etcd IP ${data.host}

1.

Beats Kubernetes Docker

2.

使

3.

IP 使

4./

Metricbeat Filebeat

使 Doker Kuberness 使 adddockermetadata or addkubernetesmetadata

6.3 使 Beats

filebeat.autodiscover:
  providers:
    - type: kubernetes
      hints.enabled: true

使 Kubernetes Pod Filebeat Metricbeat Pod Java Pod

annotations:
  co.elastic.logs/multiline.pattern: '^\['
  co.elastic.logs/multiline.negate: 'true'
  co.elastic.logs/multiline.match: after

Pod Filebeat Java

使 NGINX 访

annotations:
  co.elastic.logs/module: nginx
  co.elastic.logs/fileset.stdout: access
  co.elastic.logs/fileset.stderr: error

co.elastic.logs/fileset.

使 Metricbeat NGINX使 Metricbeat ${data.host} IP

annotations:
  co.elastic.metrics/module: nginx
  co.elastic.metrics/metricsets: stubstatus
  co.elastic.metrics/hosts: '${data.host}:80'
  co.elastic.metrics/period:10s

Filebeat Metricbeat使

使

使使 Beats