Elasticsearch Filebeat文档类型已弃用问题

问题描述:

我目前使用ELK 5.5。看起来document_type现在在Filebeats中已被弃用,但我无法在任何地方找到任何示例来了解如何现在实现它。Elasticsearch Filebeat文档类型已弃用问题

这是我在我的日志得到:

WARN DEPRECATED: document_type is deprecated. Use fields instead. 

这是我目前filebeat配置:

- input_type: log 

    # Paths that should be crawled and fetched. Glob based paths. 
    paths: 
    - C:\inetpub\logs\LogFiles\*\* 
    document_type: iislog 

    paths: 
    - C:\MyApp\logs\* 
    document_type: applog 

有人能告诉我如何使用相同的版本时,要重写我的日志5.5和摆脱这个弃用信息。顺便说一句,我确实希望为“文档类型”使用相同的ES索引。

而不是使用document_type的,你可以在Filebeat使用fields这样的:

- input_type: log 

    # Paths that should be crawled and fetched. Glob based paths. 
    paths: 
    - C:\inetpub\logs\LogFiles\*\* 
    fields: 
    service: iislog 
    fields_under_root: true 

    paths: 
    - C:\MyApp\logs\* 
    fields: 
    service: applog 
    fields_under_root: true 

现在,Logstash输出滤波器,而是采用[type]用于调用DOCUMENT_TYPE,您可以使用[service]。下面的是我如何使用上logstash:

output { 
    if [service] == "applog" { 
    elasticsearch { 
    hosts => ["localhost:9200"] 
    user => <user> 
    password => <pass> 
    index => "applog-%{+YYYY.MM.dd}" 
    } 
    } 
enter code here 

检查波纹管的有关Filebeat自定义字段的详细信息: https://www.elastic.co/guide/en/beats/filebeat/current/migration-changed-fields.html