Public repo to distribute scripts and config's
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

26 Zeilen
866 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"