timecode
timecode

Reputation: 307

How do I include the index 'title' in a kibana url?

Prior to Kibana 6, I used to be able to programatically construct a url for a Kibana query for a particular index, where the index was specified by its name/title i.e. logstash-* or my-index-*.

A constructed URL would be something like:

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-*')

Since Kibana 6, this no longer works as the 'index' appears to require an index ID(?) value such as 3dbd5d60-163c-11e9-8130-471e0fe97583.

For example, this would work:

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)

However, I have no way to know that value when the url is constructed.

Does anyone know if the index name/title can still be used in the url (obviously it would use a different key like index_title:'my-index-*' for example)?

Failing that, can Kibana be queried itself to reveal an index ID, given an index name/title?

Upvotes: 2

Views: 694

Answers (1)

leandrojmp
leandrojmp

Reputation: 7463

I don't think that you can use the index pattern on the URL anymore, you need to use the ID associated to that index pattern.

To get the ID you can use the query below on dev tools:

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

Upvotes: 1

Related Questions