Logs from multiple Hosts

Hi All,

I am exploring loki to collect logs into Grafana. So far I have one host(with loki & promtail installed) and in Grafana server, I have added new connection to the above host as loki source and then able to see the logs of this host. If I have multiple such hosts for monitoring logs, then do I need to add each such host as new connection in Grafana Loki source?

No, you have one central Loki (one datasource in Grafana) and then you will use labels to differentiate between hosts (e. g. label host, hostname, instanceid, instance,…) usually.

I see only my Grafana Loki(server) labels but not the external host’s labels? How to check if my external host is integrated with Grafana loki ?

No, you (your used tool e. g. promtail, grafana agent, otel collector,… whatever you are using) must define that label, so label will be saved in Loki.

Can you please share the config.yaml file to promtail and loki that will allow multiple hosts running promtail to send logs to one central loki running server?

i have the same question to.
how i can get logs from 2 or 3 log docker from 2 or 3 server ?