Connect multiple hosts running promtail to loki running on a separate host

Hi all first time posting here.

I have 3 different servers. This is the setup I want to achieve:

  1. Server1 (51.25.365.12): promtail
  2. Server2 ( promtail
  3. Server3 ( promtail, loki and grafana

All the promtail services’ should send the data to loki running on Server3. How will this be possible? Please share the config files for all promtail and loki yaml files.

I have tried to modified the promtail script to:

  http_listen_port: 9080
  grpc_listen_port: 0

  filename: /tmp/positions.yaml

  - url:

- job_name: system
  - targets:
      - localhost
      job: devlogs
      __path__: /home/ubuntu/john/python/logs/*log

I made no changes to the loki config.yaml file but when I connect the loki as a data connection it does not show any data.

Please help!!

Note: The IPs are not actual IPs of the servers’.