Promtail on Windows

3,918 views
Skip to first unread message

Ian Hodgetts

unread,
Jul 24, 2020, 10:20:26 AM7/24/20
to lokiproject
Although I've got a PoC install of Loki and Promtail working on a linux box, I need to actually scrape logs from various Windows servers.

Are there any examples of how to install promtail on Windows?

At the moment I'm manually running the executable with a (bastardised) config file but and having problems. I'm guessing it's to do with the paths.

e.g. What should be in the positions.yaml (it is currently creating a blank one).

Cyril Tovena

unread,
Jul 24, 2020, 1:53:27 PM7/24/20
to Ian Hodgetts, lokiproject
Hey Ian,


Promtail also serves an http server that has interesting information about discovered targets. see https://github.com/grafana/loki/blob/5a8bc848dbe453ce27576d2058755a90f79d07b6/docs/sources/getting-started/troubleshooting.md#troubleshooting-targets

You can also activate debug logs see those documents above, and yes you need to give windows path to promtail.

Let us know.

Cyril

--
You received this message because you are subscribed to the Google Groups "lokiproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lokiproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lokiproject/e00fad3f-41f4-4d88-9b25-45ac1689c7ceo%40googlegroups.com.

Ian Hodgetts

unread,
Jul 27, 2020, 5:04:38 AM7/27/20
to lokiproject
Thanks for the suggestion. I actually got it working. Schoolboy error of a missing backslash in the path!

I've (temporarily) broken it again experimenting with config, but once I've got it going again I'll post my config as an example.

On Friday, 24 July 2020 18:53:27 UTC+1, Cyril Tovena wrote:
Hey Ian,


Promtail also serves an http server that has interesting information about discovered targets. see https://github.com/grafana/loki/blob/5a8bc848dbe453ce27576d2058755a90f79d07b6/docs/sources/getting-started/troubleshooting.md#troubleshooting-targets

You can also activate debug logs see those documents above, and yes you need to give windows path to promtail.

Let us know.

Cyril

On Fri, Jul 24, 2020 at 10:20 AM Ian Hodgetts <ian.h...@capita.co.uk> wrote:
Although I've got a PoC install of Loki and Promtail working on a linux box, I need to actually scrape logs from various Windows servers.

Are there any examples of how to install promtail on Windows?

At the moment I'm manually running the executable with a (bastardised) config file but and having problems. I'm guessing it's to do with the paths.

e.g. What should be in the positions.yaml (it is currently creating a blank one).

--
You received this message because you are subscribed to the Google Groups "lokiproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lokip...@googlegroups.com.

Ian Hodgetts

unread,
Jul 27, 2020, 6:11:55 AM7/27/20
to lokiproject
OK, so it's at least starting again, but I notice I get a warning...

PS F:\promtail> F:\Promtail\promtail-windows-amd64.exe --config.file F:\Promtail\promtail-config.yaml
level=warn ts=2020-07-27T10:09:57.6255422Z caller=filetargetmanager.go:98 msg="WARNING!!! entry_parser config is depreca
ted, please change to pipeline_stages"
level=info ts=2020-07-27T10:09:57.6275369Z caller=server.go:179 http=[::]:9080 grpc=[::]:1576 msg="server listening on a
ddresses"
level=info ts=2020-07-27T10:09:57.6285371Z caller=main.go:67 msg="Starting Promtail" version="(version=1.5.0, branch=HEA
D, revision=12c7eab8)"
level=info ts=2020-07-27T10:10:02.628064Z caller=filetargetmanager.go:270 msg="Adding target" key="{job=\"SPI\"}"
level=info ts=2020-07-27T10:10:02.629045Z caller=tailer.go:80 component=tailer msg="start tailing file" path=F:\Logs\Sec
urePaymentsInterface\fbe3a386-0052-41e6-9f5c-036b414183e0SecurePaymentsInterface.log
ts=2020-07-27T10:10:02.629045Z caller=log.go:124 component=tailer level=info msg="Seeked F:\\Logs\\SecurePaymentsInterfa
ce\\fbe3a386-0052-41e6-9f5c-036b414183e0SecurePaymentsInterface.log - &{Offset:8609046 Whence:0}"
level=info ts=2020-07-27T10:10:02.6300501Z caller=tailer.go:80 component=tailer msg="start tailing file" path=F:\Logs\Se
curePaymentsInterface\SecurePaymentsInterface.log
ts=2020-07-27T10:10:02.6300501Z caller=log.go:124 component=tailer level=info msg="Seeked F:\\Logs\\SecurePaymentsInterf
ace\\SecurePaymentsInterface.log - &{Offset:89502 Whence:0}"

Ian Hodgetts

unread,
Jul 27, 2020, 6:32:41 AM7/27/20
to lokiproject
Here's my config (currently experimenting with labels but it works)...

server:
  http_listen_port: 9080
  grpc_listen_port: 0
positions:
  filename: F:\Promtail\positions.yaml
scrape_configs:
- job_name: DWEB01-SPI
  static_configs:
  - targets:
      - localhost
    labels:
      host: P360QTDWEB01
      job: SPI
      __path__: F:\Logs\SecurePaymentsInterface\*log
     
- job_name: DWEB01-CPI
  static_configs:
  - targets:
      - localhost
    labels:
      host: P360QTDWEB01     
      job: CPI
      __path__: F:\Logs\CommonPayments\*log
     
- job_name: DWEB01-CF
  static_configs:
  - targets:
      - localhost
    labels:
      host: P360QTDWEB01     
      job: CF
      __path__: F:\Logs\CommonFoundation\*log
           
- job_name: DWEB01-SBS
  static_configs:
  - targets:
      - localhost
    labels:
      host: P360QTDWEB01     
      job: SBS
      __path__: F:\Logs\SecureBureauService\*log
Reply all
Reply to author
Forward
0 new messages