Loki will not start

I have tried to get Loki running so that i can collect windows logs and I am about to give up. I have tried RHEL, Ubuntu, WIndows, SexiGraf and none of them will run loki so I know it is something I am doing.

I dont understand what I am missing…
root@RSM-GRAF:~# sudo systemctl status loki
● loki.service - Loki service
Loaded: loaded (/etc/systemd/system/loki.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2023-08-07 18:37:26 UTC; 5s ago
Process: 16940 ExecStart=/usr/local/bin/loki -config.file /etc/loki/loki-local-config.yaml (code=exited, status=1/FAILURE)
Main PID: 16940 (code=exited, status=1/FAILURE)

Is this error the yaml file? I have tried about 100 of those too.

1 Like

By itself, this probably isn’t enough information to tell what’s going on.

Can you check your loki system logs (probably in /var/log or other linux-configured logging directory) and report back on what they say?

It looks like all this says is that the process didn’t start. Figuring out why requires consulting logs.

failed parsing config: /etc/loki/loki-local-config.yaml: yaml: unmarshal errors:
line 1: field xauth_enabled not found in type loki.ConfigWrapper. Use -config.expand-env=true flag if you want to expand environment variables in your config file

1 Like

I think you got me what I needed. I found the latest here https://raw.githubusercontent.com/grafana/loki/v2.8.3/cmd/loki/loki-local-config.yaml

Ok so Now I got that started. I want to collect windows machines with grafana agent. What do I need to do to loki to get those logs?

Do you install the Agent on all machines and send the data to Loki? How does Loki know where the data is coming from? I dont get it.

1 Like

Yes, you’re going to install Grafana Agent on each of the machines you want to collect logs from, and you’re going to configure it according to these instructions:

The architecture is something akin to:

(Windows Machine + Agent) → loki