0

sql语句

statement => "select ref_id,index_name,type,content from t_backup_es_data where backup_id >= :sql_last_value"

返回类型列的值有提案和报价

if[%{type}] == "quotation" {
        elasticsearch {
            hosts => "localhost:9200"
            index => "%{index_name}"
            document_type => "%{type}"
            document_id => "%{ref_id}"
            manage_template => true
            template_overwrite => true
            template => "../config/quotationMapping.json"
        }   
    }else if[%{type}] == "proposal" {
        elasticsearch {
            hosts => "localhost:9200"
            index => "%{index_name}"
            document_type => "%{type}"
            document_id => "%{ref_id}"
            manage_template => true
            template_overwrite => true
            template => "../config/proposalMapping.json"
        }
    }

此配置不起作用,您有什么建议?

4

1 回答 1

0

假设您使用的是 JDBC 输入插件,文档说明:

结果集中的列被转换为事件中的字段

我将从标准输出开始,看看你有什么。ELK 堆栈过去使用“类型”作为内部字段,因此它可能就像重命名查询中的列一样简单。

于 2018-11-27T21:39:06.747 回答