【发布时间】:2021-05-21 14:13:48
【问题描述】:
我正在使用 fluentd 将数据发布到 elasticsearch。它有一个字段Data.CPU,当前设置为string。索引名称为health_gateway
我对生成数据的 python 代码进行了一些更改,所以现在这个字段Data.CPU 现在变成了integer。但是弹性搜索仍然将其显示为字符串。如何更新它的数据类型。
我尝试在 kibana 开发工具中运行以下命令:
PUT health_gateway/doc/_mapping
{
"doc" : {
"properties" : {
"Data.CPU" : {"type" : "integer"}
}
}
}
但它给了我以下错误:
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
}
],
"type" : "illegal_argument_exception",
"reason" : "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
},
"status" : 400
}
还有这个document 说使用mutate 我们可以转换数据类型,但我无法正确理解。
我不想删除索引并重新创建,因为我已根据此索引创建了可视化,删除后它也会被删除。任何人都可以在这方面提供帮助。
【问题讨论】:
-
您链接到的文档是关于 Logstash - 您能否确认您使用的是 Fluentd 的 Logstash 吗?
-
不,我正在使用 fluentd。 Fluentd 正在将我所有的日志从 ubuntu 机器上传到 elasticsearch
标签: elasticsearch type-conversion kibana