Filebeat start config wrong

I've tried to read my nginx logs trough filebeats on Windows (for test) but something goes wrong. Can You suggest?

- module: nginx
  # Access logs
  access:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:
     var.paths: 'C:\\Users\\test\\Documents\\elk\\mylog\\nginx_access.log'

# Error logs
  error:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:
     var.paths: 'C:\\Users\\test\\Documents\\elk\\mylog\\nginx_error.log'
  # Ingress-nginx controller logs. This is disabled by default. It could be used in Kubernetes environments to parse ingress-nginx logs
  ingress_controller:
    enabled: false

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:

"log.level":"error","@timestamp":"2022-11-22T02:51:12.327+0100","log.origin":{"file.name":"cfgfile/reload.go","file.line":273},"message":"Error loading config from file 'C:\Program Files\Filebeat\modules.d\nginx.yml', error invalid config: yaml: line 11: did not find expected key","service.name":"filebeat","ecs.version":"1.6.0"}`Preformatted text

Hi @INS

It seems you have wrong indentations:

- module: nginx
  # Access logs
  access:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:
    var.paths: 'C:\\Users\\test\\Documents\\elk\\mylog\\nginx_access.log' # extra ' ' in this line

# Error logs
  error:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:
    var.paths: 'C:\\Users\\test\\Documents\\elk\\mylog\\nginx_error.log' # extra ' ' in this line
  # Ingress-nginx controller logs. This is disabled by default. It could be used in Kubernetes environments to parse ingress-nginx logs
  ingress_controller:
    enabled: false

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.