Promtail .yaml error

I got the error while trying to run promtail:


C:\Users\umutc\Desktop\LokiPromtail>.\promtail-windows-amd64.exe --config.file=promtail-local-config.yaml
Unable to parse config: promtail-local-config.yaml: yaml: line 29: did not find expected key. Use `-config.expand-env=true` flag if you want to expand environment variables in your config file

my configuration file is this:

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://localhost:3100/loki/api/v1/push

scrape_configs:
- job_name: system
  pipeline_stages:
    - match:
        selector: '{job="system_logs"}'
        stages:
        - regex:
           expression: '(?P<ip>^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*(?P<datetime>[0-9]{2}\/[a-zA-Z]{3}\/[0-9]{1,4}:[0-9]{2}:[0-9]{2}:[0-9]{2}).*(?P<method>DELETE|PUT|POST|GET).*(?P<endpoint>usr/[a-z]*/[a-z]*|usr/[a-z]*|usr).*(?P<status> [0-9]{3})(?P<response_bytes> [0-9]{4} ).*(?P<user_agent>"(.*?)").*(?P<response_time> [0-9]{2,4})'
        - labels:
           ip:
           method:
           endpoint:
           status:
           response_bytes:
           user_agent:
           response_time:
        - timestamp:
           source: datetime
           format: "02/Jan/2006:15:04:05"
  static_configs:
  - targets:
      - localhost
    labels:
      job: varlogs
      __path__: C:/Users/umutc/Desktop/denme.log
      stream: stdout

I have controlled it countless times but found nothing :frowning:

The source of your timestamp configuration (datetime) doesn’t exist.

Also your indentation isn’t quite right. Still a valid yaml, but might want to fix it anyway.