0

I am using docker-compose setup of loki on my windows system and I want to change promtial configuration to access my windows log files. But it seams that docker not able to access outside path.

- job_name: test
  static_configs:
  - targets:
      - test
    labels:
      job: test
      __path__: "F:/project/test/logs/*.log"

Answer:
promtail:
    image: grafana/promtail:2.4.0
    volumes:
      - F:/project/test/src/logs:/test/logs
    command: -config.file=/etc/promtail/config.yml
    networks:
      - loki
Navneet Garg
  • 1,364
  • 12
  • 29
  • That's right. Containers can't access files outside their own file system for security reasons. So you need to map F:\project\test\logs to a path in the container using a volume mapping and then use the path in the container for promtail. – Hans Kilian Nov 18 '21 at 08:06
  • Humm, finally able to solve as suggested I change docker-compose.yml file and mount using volumes. – Navneet Garg Nov 19 '21 at 08:06
  • Maybe @HansKilian can turn this comment into an answer so OP can approve it? – JustLudo Nov 19 '21 at 09:18

0 Answers0