# This Fluentd configuration file specifies the colleciton
# of all Docker container log files under /var/lib/docker/containers/...
# followed by ingestion using the Google Cloud Logging API.
# This configuration assumes the correct installation of the the
# Google fluentd plug-in. Currently the collector uses a text format
# rather than JOSN (which is the format used to store the Docker
# log files). When the fluentd plug-in can accept JSON this
# configuraiton file should be changed by specifying:
#    format json
# in the source section.
# This configuration file assumes that the VM host running
# this configuraiton has been created with a logging.write scope.
# Maintainer: Satnam Singh (satnam@google.com)

<source>
  type tail
  format none
  time_key time
  path /var/lib/docker/containers/*/*-json.log
  time_format %Y-%m-%dT%H:%M:%S
  tag docker.container.*
</source>

<match docker.container.**>
  type google_cloud
  flush_interval 5s
  # Never wait longer than 5 minutes between retries.
  max_retry_wait 300
  # Disable the limit on the number of retries (retry forever).
  disable_retry_limit
</match>
