如果用的7.x版本的,大概率是没有配置 document_type
output {
if [type]=="tb_tool"{
elasticsearch {
# 如果不配置type,动态模板会创建失败
document_type => "_doc"
hosts => ["10.0.14.40:31815"]
# 索引名称
index => "tb_tool"
# 文档id,inquiryId为sql文件中查询出的字段名
document_id => "%{id}"
#如果设置为true,模板名字一样的时候,新的模板会覆盖旧的模板
template_overwrite => true
template_name => "tb_tool"
#映射配置文件的位置
template => "../config/test.json"
}
stdout {
# JSON格式输出
codec => json_lines
}
}
}