Getting msg="final error sending batch" status=405

Hi,
I am having a hard time to get started with loki + promtail.
All I want is to monitor custom log files in a folder and send them to Loki.
Loki is running fine (it seems).
But promtail gives this error:
level=error ts=2024-01-26T10:53:21.100276Z caller=client.go:430 component=client host=loki.MyServer.com msg=“final error sending batch” status=405 tenant= error="server returned HTTP status 405 Method Not Allowed (405): "

The promtail config.yml is:

server:
  http_listen_port: 9080
  grpc_listen_port: 0
positions:
  filename: 'E:\promtail\positions.yaml'
clients:
  - url: http://loki.MyServer.com/loki/api/v1/push
  
scrape_configs:
  - job_name: MyAgent
    static_configs:
      - targets:
          - localhost
        labels:
          job: MyAgent
          __path__: >-
            E:\MyLogs\*.log

Any one could please give a hint what is wrong? Documentation has not really any good infos how to work with local log files from custom applications…

Found my mistake! I am having loki endpoint under https not http.

1 Like