Public repo to distribute scripts and config's
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 

27 lignes
867 B

  1. #!/bin/sh -e
  2. # This script will setup docker to push all newly created container logs to https://int.loki.grid.tf
  3. # NOTE: existing containers will need to be recreated to send their logs to Loki
  4. ### Install docker plugin
  5. docker plugin install grafana/loki-docker-driver:2.9.2 --alias loki --grant-all-permissions
  6. ### Edit docker daemon config file
  7. cat << EOF > /etc/docker/daemon.json
  8. {
  9. "debug" : true,
  10. "log-driver": "loki",
  11. "log-opts": {
  12. "loki-url": "https://int.loki.grid.tf/loki/api/v1/push",
  13. "loki-batch-size": "400",
  14. "loki-retries": "2",
  15. "loki-max-backoff": "800ms",
  16. "loki-timeout": "1s",
  17. "keep-file": "true"
  18. }
  19. }
  20. EOF
  21. ### Restart docker
  22. systemctl restart docker
  23. echo "Don't forget to recreate all containers that should send their logs to Loki! This config does not apply to existing containers"