Sign inSign up

logzio/docker-collector-logs

By logzio

•Updated about 1 year ago

Docker container that collect logs from other containers and forward those logs to Logz.io

Image
1

10M+

logzio/docker-collector-logs repository overview

⁠docker-collector-logs

docker-collector-logs is a Docker container that uses Filebeat to collect logs from other Docker containers and forward those logs to your Logz.io account.

To use this container, you'll set environment variables in your docker run command. docker-collector-logs uses those environment variables to generate a valid Filebeat configuration for the container. docker-collector-logs mounts docker.sock and the Docker logs directory to the container itself, allowing Filebeat to collect the logs and metadata.

docker-collector-logs ships logs only. If you want to ship metrics to Logz.io, see docker-collector-metrics⁠.

⁠docker-collector-logs setup

⁠1. Pull the Docker image

Download the logzio/docker-collector-logs image:

docker pull logzio/docker-collector-logs
⁠2. Run the container

For a complete list of options, see the parameters below the code block.👇

docker run --name docker-collector-logs \
--env LOGZIO_TOKEN="<ACCOUNT-TOKEN>" \
--env LOGZIO_URL="<LISTENER-URL>:5015" \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /var/lib/docker/containers:/var/lib/docker/containers \
logzio/docker-collector-logs
⁠Parameters
ParameterDescription
LOGZIO_TOKENRequired. Your Logz.io account token. Replace <ACCOUNT-TOKEN> with the token⁠ of the account you want to ship to.
LOGZIO_URLRequired. Logz.io listener URL to ship the logs to. This URL changes depending on the region your account is hosted in. For example, accounts in the US region ship to listener.logz.io, and accounts in the EU region ship to listener-eu.logz.io.
For more information, see Account region⁠ on the Logz.io Docs.
LOGZIO_TYPEDefault: Docker image name
The log type you'll use with this Docker. This is shown in your logs under the type field in Kibana.
Logz.io applies parsing based on type.
LOGZIO_CODECDefault: plain
Set to json if shipping JSON logs. Otherwise, set to plain.
matchContainerNameComma-separated list of containers you want to collect the logs from. If a container's name partially matches a name on the list, that container's logs are shipped. Otherwise, its logs are ignored.
Note: Can't be used with skipContainerName
skipContainerNameComma-separated list of containers you want to ignore. If a container's name partially matches a name on the list, that container's logs are ignored. Otherwise, its logs are shipped.
Note: Can't be used with matchContainerName
additionalFieldsInclude additional fields with every message sent, formatted as "fieldName1=fieldValue1;fieldName2=fieldValue2".
To use an environment variable, format as "fieldName1=fieldValue1;fieldName2=$ENV_VAR_NAME". In that case, the environment variable should be the only value in the field. In case the environment variable can't be resolved, the field will be omitted.

Note: By default, logs from docker-collector-logs and docker-collector-metrics containers are ignored.

⁠3. Check Logz.io for your logs

Spin up your Docker containers if you haven’t done so already. Give your logs a few minutes to get from your system to ours, and then open Kibana⁠.

⁠Change log
  • 0.0.3: Support additional fields
  • 0.0.2: Add an option to configure logzio_codec and logzio_type

Tag summary

Content type

Image

Digest

sha256:ae6da3b0f…

Size

59.2 MB

Last updated

about 1 year ago

docker pull logzio/docker-collector-logs