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'
-
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 |
The container
input supports the following configuration options plus the
[{beatname_lc}-input-container-common-options] described later.
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"