gpt4 book ai didi

elasticsearch - Filebeat-如何覆盖Elasticsearch字段映射?

转载 作者:行者123 更新时间:2023-12-02 23:19:00 28 4
gpt4 key购买 nike

我们正在通过filebeat将数据摄取到Elasticsearch并遇到配置问题。
我正在尝试为特定字段指定日期格式(标准@timestamp字段保留索引时间,我们需要实际的事件时间)。到目前为止,我无法这样做-我尝试了单独的json模板文件fields.yml,并在filebeat.yml中内联指定了它。最后一个选项只是一个猜测,我还没有找到此特定配置组合的任何示例。
我在这里想念什么?我确信这应该可行:

filebeat.yml

 #rest of the file
template:

# Template name. By default the template name is filebeat.
#name: "filebeat"

# Path to template file
path: "custom-template.json"

并在custom-template.json中
{
"mappings": {
"doc": {
"properties": {
"eventTime": {
"type": "date",
"format": "YYYY-MM-dd HH:mm:ss.SSSS"
}
}
}
}
}

但事实并非如此。
我们使用的Filebeat版本是6.2.4和Elasticsearch 6.x

最佳答案

我无法使Filebeat配置正常工作。因此,最终在我们的服务中更改了时间字段格式,并且立即生效。
我发现Filebeat的官方文档缺少完整的示例。可能那只是我的问题

实际上是EDIT,事实证明您可以指定允许格式的列表in your mapping

关于elasticsearch - Filebeat-如何覆盖Elasticsearch字段映射?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51638019/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com