Cannot start promtail on windows server

Hi,
we are just starting a Grafana Loki test. I’m actually from the Windows world, but now I’m supposed to check if we can also use Loki as a central collection point for Windows event logs.
I downloaded the current “promtail-windows-amd64.exe” and copied it to a test Windows server to “C:\promtail”. There I also created a tmp directory and a “promtail-config.yaml”.
When I try to start promtail via “promtail-windows-amd64.exe --config.file=promtail_config.yaml”, I get the following error message:
"Unable to parse config: promtail_config.yaml: yaml: unmarshal errors:
line 13: field windows_events not found in type scrapeconfig.plain
"
What am I doing wrong?

Thanks

My promtail-config.yaml:
server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: ./tmp/positions.yaml

clients:

scrape_configs:

  • job_name: windows
    windows_events:
    use_incoming_timestamp: false
    bookmark_path: “./bookmark.xml”
    eventlog_name: “Application”
    xpath_query: ‘*’
    labels:
    job: windows
    relabel_configs:
    • source_labels: [‘computer’]
      target_label: ‘host’

Hey @frankbo - please paste your promtail config as plain text:
image

I hope this is in plain text now:

server:
 http_listen_port: 9080
 grpc_listen_port: 0

positions:
  filename: ./tmp/positions.yaml

clients:
  - url: https://xxxxx.yyy/api/v1/push

scrape_configs:
- job_name: windows
  windows_events:
    use_incoming_timestamp: false
    bookmark_path: "./bookmark.xml"
    eventlog_name: "Application"
    xpath_query: '*'
    labels:
      job: windows
  relabel_configs:
    - source_labels: ['computer']
      target_label: 'host'
1 Like

Thank you.

I don’t see anything obviously wrong at first glance.
What version of Promtail are you using?

Hi.

C:\promtail>promtail-windows-amd64.exe --version

promtail, version 2.1.0 (branch: HEAD, revision: 1b79df37)
build user: root@b8941a81fe55
build date: 2020-12-24T14:08:17Z
go version: go1.15.3
platform: windows/amd64

There’s the issue - the windows_events promtail target is not available in v2.1.0:

It’ll be included in an upcoming v2.2 release.

That’s an explanation, even if unfortunately for us it means we can just wait.

I would never have found this issue myself.

Thanks a lot
Frank

1 Like