Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 1.7 KB

input-container.asciidoc

File metadata and controls

69 lines (46 loc) · 1.7 KB

Container input

Container

Use the container input to read containers log files.

This input searches for container logs under the given path, and parse them into common message lines, extracting timestamps too. Everything happens before line filtering, multiline, and JSON decoding, so this input can be used in combination with those settings.

Example configuration:

{beatname_lc}.inputs:
- type: container
  paths: <1>
    - '/var/log/containers/*.log'
  1. paths is required. All other settings are optional.

Note
'/var/log/containers/.log' is normally a symlink to '/var/log/pods//*/.log', so above path can be edited accordingly

Configuration options

The container input supports the following configuration options plus the [{beatname_lc}-input-container-common-options] described later.

stream

Reads from the specified streams only: all, stdout or stderr. The default is all.

format

Use the given format when reading the log file: auto, docker or cri. The default is auto, it will automatically detect the format. To disable autodetection set any of the other options.

The following input configures {beatname_uc} to read the stdout stream from all containers under the default Kubernetes logs path:

- type: container
  stream: stdout
  paths:
    - "/var/log/containers/*.log"