![](/img/trans.png)
[英]ElasticSearch - what is the difference between an index template and an index pattern
[英]elasticsearch index template pattern with regex
我想提供一個模板來每月創建一個新索引,所以模式是myindex-yyyy-MM
。 我只讓它與模式myindex-*
一起工作,但它也會匹配索引myindex-abc
例如。
如何將索引模板模式指定為正則表達式? 這就是我嘗試過的:
patterns: "myindex-\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])"
不要認為你可以用正則表達式定義索引模式,但是,在你的鞋子里,我會簡單地用myindex-20*
索引模式來解決它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.