代码之家  ›  专栏  ›  技术社区  ›  Dhiraj

Windows上的filebeat yml文件有问题

  •  0
  • Dhiraj  · 技术社区  · 5 年前

    .\filebeat.exe setup -e

    2019-02-05T20:53:10.515+0530    INFO    elasticsearch/client.go:165     Elasticsearch url: http://localhost:9200
    2019-02-05T20:53:10.520+0530    INFO    elasticsearch/client.go:721     Connected to Elasticsearch version 6.6.0
    2019-02-05T20:53:10.520+0530    INFO    kibana/client.go:118    Kibana url: http://localhost:5601
    2019-02-05T20:53:10.567+0530    WARN    fileset/modules.go:388  X-Pack Machine Learning is not enabled
    2019-02-05T20:53:10.572+0530    ERROR   instance/beat.go:911    Exiting: 1 error: error loading config file: invalid con
    fig: yaml: line 4: did not find expected hexdecimal number
    

    我的filebeat.yml文件如下所示:

    filebeat.inputs:
    
    - type: log
      enabled: true
      paths: C:\Users\bigdataadmin\Downloads\ApacheLogs\*
    
    
    #============================= Filebeat modules ===============================
    
    filebeat.config.modules:
    
      path: C:\Program Files\Filebeat\modules.d\*.yml
      reload.enabled: true
      reload.period: 60s
    
    #==================== Elasticsearch template setting ==========================
    
    setup.template.settings:
      index.number_of_shards: 3
    
    setup.kibana:
      host: "localhost:5601"
    
    output.elasticsearch:
    
      hosts: ["localhost:9200"]
    
    
    # Configure processors to enhance or manipulate events generated by the beat.
    
    processors:
      - add_host_metadata: ~
      - add_cloud_metadata: ~
    

    我还查了yml http://www.yamllint.com/

    我使用的是filebeat 6.6

    1 回复  |  直到 5 年前
        1
  •  0
  •   Surendra Deshpande    5 年前

    路径键(第4行)是一个数组。所以你需要在那里表示一个数组。

    例子:

    filebeat.inputs:
    - type: log
      enabled: true
      paths:
        - C:\Users\bigdataadmin\Downloads\ApacheLogs\*