Beatsを使用したDockerおよびKubernetesのヒントベースの自動探知機能(Autodiscover) | Elastic Blog
エンジニアリング

Beatsを使用したDockerおよびKubernetesのヒントベースの自動探知機能(Autodiscover)

6.0BeatsFilebeatMetricbeatDockerKubernetesAutodiscoverBeats

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”]

docker使Metricbeat使etcd 使etcdMetricbeatetcd${data.host}IP

1.

BeatsKubernetesDocker

2.

使1

3.

IP使

4./

MetricbeatFilebeatFilebeat

使DockerKubernetesadddockermetadataaddkubernetesmetadata使便

6.3 使Beats

KubernetesFilebeatKubernetes

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

KubernetesDocker使FilebeatMetricbeatJava

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

FilebeatJava

使NGINX

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

co.elastic.logs/fileset

Metricbeat使NGINXMetricbeatIP${data.host}使

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

FilebeatMetricbeat使

使Beats