用了Elasticsearch,一口气上5T

filebeat数据直接输出elasticsearch,index可以动态定义,能否定义动态的type和id值?

Beats | 作者 Aruen | 发布于2018年12月29日 | 阅读数:3019

filebeat.prospectors:
- input_type: log
paths:
- /var/log/test/*.dat
document_type: "test"
json.overwrite_keys: true
json.keys_under_root: true
processors:
- drop_fields:
fields: ["@timestamp","sort","beat","input_type","offset","source"]
output.elasticsearch:
hosts: ["47.105.162.69:9200"]
index: "test-%{[date]}"
type: "%{[type]}"
id: "%{[id]}"
template.path: "/usr/template/test.json"
template.name: "test"
template.overwrite: true
已邀请:

Aruen - 算法工程师

赞同来自:

//zai在esduan端d端的shuju端的数据,zheli这里index: "test-%{[date]-%{[id]}-%{[type]}}"但是
//但是但是但是type、id没有修改成功
{
"_index": "test-20181224--254755562086249968-test",
"_type": "doc",
"_id": "AWf4ujDp-pwklYR57iNe",
"_version": 1,
"_score": 1,
"_source": {
"date": "20181224",
"id": -254755562086250000,
"type": "test"
}
}

rochy - rochy_he

赞同来自:

filebeat 貌似不支持 document_type 和 document_id 这两个配置项
你可以通过配置 pipeline 来对数据做后续处理

要回复问题请先登录注册