How can I get list of index pattern in Kibana

Hello,

I am building a Kibana (6.2.4) application and I need to get list of index pattern which I've created (like the Discover).

How can I do that ?

Regards ^^

Hello,
You could use the following rest end point http://localhost:9200/_cat/indices?v This will list all the indices present in Elasticsearch.

When I issued this command I got something like this:

health status index                         uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   apm-6.4.0-2017.05.30          PZobQbMTRKeT-0c_uZ_ioA   1   1          9            0     27.3kb         27.3kb
green  open   makelogs-0                    bJDjY0kFSyOM-rNnpGzKQg   1   0      14005            0     80.9mb         80.9mb
yellow open   metricbeat-6.4.0-2018.08.21   O0a6hlbXR_Ckq5RFXlkrSg   5   1     163904            0     40.8mb         40.8mb
green  open   .security-6                   JXx0zEtMQyKpVFh2M72-6A   1   0          3            0     13.2kb         13.2kb
green  open   .reporting-2018.08.19         pFaS564iQGSnThgBDff2SA   1   0          1            0     62.8kb         62.8kb
yellow open   packetbeat-6.4.0-2018.08.21   zFPg_YTqQGKoHmTqtMy88A   5   1       5361            0      1.5mb          1.5mb
yellow open   logstash-2018.08.22           kNIP3cE5SKKKqhf6ViHJUA   5   1        183            0    195.6kb        195.6kb
green  open   .kibana                       EwhbRCThQQG_-bHYNORU1w   1   0        447            2    493.9kb        493.9kb
green  open   .watcher-history-9-2018.08.21 RFpioNEKTgijm4ZCkdaXRQ   1   0          2            0       10kb           10kb
green  open   .watcher-history-9-2018.08.22 Pi90Uv6TT9GeSETXbbncPQ   1   0          6            0     29.5kb         29.5kb
green  open   .triggered_watches            VTqiAtoARGOjd4zRlWnbDQ   1   0          0            0       259b           259b
yellow open   filebeat-6.4.0-2018.08.21     xXWuUB-ARPWmCuaK_azFrg   5   1        987            0      288kb          288kb
green  open   .watches                      m_envTenQwKF0tlsBAPmHQ   1   0          1            0      3.9kb          3.9kb
yellow open   logstash-2018.08.21           9XZ1WPWxTziVewg349RrJg   5   1       4418            0    995.1kb        995.1kb
yellow open   apm-6.4.0-2018.08.21          MBE4xfmNTR6qvtfCtE4J9Q   1   1          1            0        6kb            6kb

More info can be found here: https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html

Cheers
Rashmi

1 Like

Thanks @rashmi :smiley:

I need list of index pattern, not the list of index.
Actually, I got my target (just for few minutes :sweat_smile:) !

This is my server.js:

client.search({
   index: ".kibana"
}, function (err,response) {
    reply(response);
}); 

And in the app.js, I trait the response and get the list of hits where _source.type="index-pattern".
screenshot

But this is working only if the index .kibana contains the list of index pattern created.
Is there another way ? Because I've a kibana docker where my app is running but I can't find any index with type index-pattern (I hope you understood me :sweat_smile: )

My Kibana container:

I already have a list of index pattern:

screenshot3

But in the .kibana index, I can't find any index-pattern :face_with_raised_eyebrow:

Any explanation ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.