如何在kibana网址中包含索引“ title”?

时间:2019-01-12 08:15:01

标签: kibana

在Kibana 6之前,我曾经能够以编程方式为特定索引的Kibana查询构造一个url,其中该索引由其名称/标题(即logstash-*my-index-*指定)。

构造的URL类似于:

http://127.0.0.1:5601/app/kibana#/discover?_g=(time:(from:now-1h,mode:quick,to:now))&_a=(query:(language:lucene,query:'my search goes here'),index:'my-index-*')

自Kibana 6起,它不再起作用,因为“索引”似乎需要索引ID(?)值,例如3dbd5d60-163c-11e9-8130-471e0fe97583

例如,这将起作用:

http://127.0.0.1:5601/app/kibana#/discover?_g=(time:(from:now-1h,mode:quick,to:now))&_a=(query:(language:lucene,query:'my search goes here'),index:3dbd5d60-163c-11e9-8130-471e0fe97583)

但是,在构建url时我无法知道该值。

有人知道索引名称/标题是否仍可以在网址中使用(显然,它会使用诸如index_title:'my-index-*'之类的其他键)吗?

如果不给定索引名称/标题,是否可以查询Kibana本身以显示索引ID?

1 个答案:

答案 0 :(得分:1)

我认为您无法再在URL上使用index pattern,您需要使用与该ID关联的index pattern

要获取ID,您可以在开发工具上使用以下查询:

GET .kibana/_search
{
   "_source": ["index-pattern.title"],
   "query": { "term": { "type": "index-pattern" }}
}
相关问题