Skip to content

Commit

Permalink
Use container input in doc examples (elastic#12864)
Browse files Browse the repository at this point in the history
Documentation examples are still using the deprecated `docker` input,
this change updates them to make use of the new `container` input, with
the same behavior expected.
  • Loading branch information
Carlos Pérez-Aradros Herce authored Jul 15, 2019
1 parent 2afe0bd commit 454b0a3
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 49 deletions.
17 changes: 7 additions & 10 deletions filebeat/_meta/common.reference.inputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,17 +360,14 @@ filebeat.inputs:
# default to `required` otherwise it will be set to `none`.
#ssl.client_authentication: "required"

#------------------------------ Docker input --------------------------------
# Experimental: Docker input reads and parses `json-file` logs from Docker
#- type: docker
#------------------------------ Container input --------------------------------
#- type: container
#enabled: false

# Combine partial lines flagged by `json-file` format
#combine_partials: true
# Paths for container logs that should be crawled and fetched.
#paths:
# -/var/lib/docker/containers/*/*.log

# Use this to read from all containers, replace * with a container id to read from one:
#containers:
# stream: all # can be all, stdout or stderr
# ids:
# - '*'
# Configure stream to filter to a specific stream: stdout, stderr or all (default)
#stream: all

2 changes: 1 addition & 1 deletion filebeat/_meta/common.reference.p2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# - condition:
# equals.docker.container.image: busybox
# config:
# - type: log
# - type: container
# paths:
# - /var/lib/docker/containers/${data.docker.container.id}/*.log

Expand Down
14 changes: 6 additions & 8 deletions filebeat/docs/autodiscover-docker-config.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ Filebeat supports templates for inputs and modules.
filebeat.autodiscover:
providers:
- type: docker
labels.dedot: true
templates:
- condition:
contains:
docker.container.image: redis
config:
- type: docker
containers.ids:
- "${data.docker.container.id}"
- type: container
paths:
- /var/lib/docker/containers/${data.docker.container.id}/*.log
exclude_lines: ["^\\s+[\\-`('.|_]"] # drop asciiart lines
-------------------------------------------------------------------------------------
Expand All @@ -27,7 +26,6 @@ If you are using modules, you can override the default input and use the docker
filebeat.autodiscover:
providers:
- type: docker
labels.dedot: true
templates:
- condition:
contains:
Expand All @@ -36,7 +34,7 @@ filebeat.autodiscover:
- module: redis
log:
input:
type: docker
containers.ids:
- "${data.docker.container.id}"
type: container
paths:
- /var/lib/docker/containers/${data.docker.container.id}/*.log
-------------------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions filebeat/docs/autodiscover-hints.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ filebeat.autodiscover:
hints.default_config:
type: container
paths:
/var/log/container/*-${container.id}.log # CRI path
- /var/log/container/*-${container.id}.log # CRI path
-------------------------------------------------------------------------------------

You can also disable default settings entirely, so only Pods annotated like `co.elastic.logs/enabled: true`
Expand Down Expand Up @@ -176,7 +176,7 @@ filebeat.autodiscover:
hints.default_config:
type: container
paths:
/var/log/container/*-${container.id}.log # CRI path
- /var/log/container/*-${container.id}.log # CRI path
-------------------------------------------------------------------------------------

You can also disable default settings entirely, so only containers labeled with `co.elastic.logs/enabled: true`
Expand Down
12 changes: 6 additions & 6 deletions filebeat/docs/autodiscover-kubernetes-config.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ filebeat.autodiscover:
equals:
kubernetes.namespace: kube-system
config:
- type: docker
containers.ids:
- "${data.kubernetes.container.id}"
- type: container
paths:
- /var/log/container/*-${data.kubernetes.container.id}.log
exclude_lines: ["^\\s+[\\-`('.|_]"] # drop asciiart lines
-------------------------------------------------------------------------------------
Expand All @@ -34,7 +34,7 @@ filebeat.autodiscover:
- module: redis
log:
input:
type: docker
containers.ids:
- "${data.kubernetes.container.id}"
type: container
paths:
- /var/log/container/*-${data.kubernetes.container.id}.log
-------------------------------------------------------------------------------------
19 changes: 8 additions & 11 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -737,19 +737,16 @@ filebeat.inputs:
# default to `required` otherwise it will be set to `none`.
#ssl.client_authentication: "required"

#------------------------------ Docker input --------------------------------
# Experimental: Docker input reads and parses `json-file` logs from Docker
#- type: docker
#------------------------------ Container input --------------------------------
#- type: container
#enabled: false

# Combine partial lines flagged by `json-file` format
#combine_partials: true
# Paths for container logs that should be crawled and fetched.
#paths:
# -/var/lib/docker/containers/*/*.log

# Use this to read from all containers, replace * with a container id to read from one:
#containers:
# stream: all # can be all, stdout or stderr
# ids:
# - '*'
# Configure stream to filter to a specific stream: stdout, stderr or all (default)
#stream: all

#========================== Filebeat autodiscover ==============================

Expand All @@ -764,7 +761,7 @@ filebeat.inputs:
# - condition:
# equals.docker.container.image: busybox
# config:
# - type: log
# - type: container
# paths:
# - /var/lib/docker/containers/${data.docker.container.id}/*.log

Expand Down
19 changes: 8 additions & 11 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -896,19 +896,16 @@ filebeat.inputs:
# default to `required` otherwise it will be set to `none`.
#ssl.client_authentication: "required"

#------------------------------ Docker input --------------------------------
# Experimental: Docker input reads and parses `json-file` logs from Docker
#- type: docker
#------------------------------ Container input --------------------------------
#- type: container
#enabled: false

# Combine partial lines flagged by `json-file` format
#combine_partials: true
# Paths for container logs that should be crawled and fetched.
#paths:
# -/var/lib/docker/containers/*/*.log

# Use this to read from all containers, replace * with a container id to read from one:
#containers:
# stream: all # can be all, stdout or stderr
# ids:
# - '*'
# Configure stream to filter to a specific stream: stdout, stderr or all (default)
#stream: all

#------------------------------ NetFlow input --------------------------------
# Experimental: Config options for the Netflow/IPFIX collector over UDP input
Expand Down Expand Up @@ -978,7 +975,7 @@ filebeat.inputs:
# - condition:
# equals.docker.container.image: busybox
# config:
# - type: log
# - type: container
# paths:
# - /var/lib/docker/containers/${data.docker.container.id}/*.log

Expand Down

0 comments on commit 454b0a3

Please sign in to comment.