创建新的模式索引时,如何在Elastic Search中设置默认映射? [英] How can I setup a default mapping in Elastic Search when it creates a new Patterned Index?

查看:68
本文介绍了创建新的模式索引时,如何在Elastic Search中设置默认映射?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经能够解决此但是,当有更多的日志条目进入时,它将无法解决我的问题,这将导致字段发生冲突(例如,在我的 Long 中而不是 Float 中情况),尤其是当它翻转以创建特定模式的新索引(即第二天)时,例如:2017年1月1日为log-20170101,但第二天将变为20170102,不会具有我在以前的索引上应用的应用映射.

But it won't fix my problem going forward when more log entries come in that will cause a field to be conflicting (as in Long instead of Float in my case), especially when it rolls over to create a new Index of a specific pattern (i.e. the next day), for example: log-20170101 on the 1st of January 2017, but on the next day it will become 20170102 which won't have the applied mapping that I applied on the previous indexes.

如何设置Elastic Search在新创建的以"log"开头的索引上应用映射?

How can I setup Elastic Search to apply a mapping on newly created Indexes that start with "log"?

推荐答案

我遇到了称为通过采用在重新索引过程中定义的映射(请参见 answer ),我能够为构成索引模式"log- *"一部分的索引设置模板.

By taking my mappings that I defined in the Re-Index process (see this answer), I was able to setup a Template for the Indexes that forms part of the Index Pattern "log-*".

额外的好处是,无论我告诉Kibana多少次刷新索引模式,它都不会添加新的关键字或更改任何定义的类型,因此我终于可以知道我的给定字段一直在只要值是数字,冲突"现在将被解释为 Float .

The added benefit was that, no matter how many times I told Kibana to refresh my Index Patterns it never added new keywords or changed any of the defined types, so I can finally rest in knowing that my given field that was constantly "conflicting" will now be interpreted as Float as long as the value is numeric.

这篇关于创建新的模式索引时,如何在Elastic Search中设置默认映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆