Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show index creation time with _cat/indices API in Elasticsearch

I am using Elasticsearch 5.2, and cannot see index creation time with http://localhost:9200/_cat/indices?v.

Just wonder what options will show index creation time for each of the indices.

like image 392
dapangmao Avatar asked Mar 03 '17 15:03

dapangmao


People also ask

What is Elasticsearch indexing time?

By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.

How do I see all indices in Elasticsearch?

You can query localhost:9200/_status and that will give you a list of indices and information about each.

Does Elasticsearch automatically create index?

By default, Elasticsearch has a feature that will automatically create indices. Simply pushing data into a non-existing index will cause that index to be created with mappings inferred from the data.

How many indices can Elasticsearch create?

Continuing our e-commerce app example, you could have one index containing all of the data related to the products and another with all of the data related to the customers. You can have as many indices defined in Elasticsearch as you want.


1 Answers

Have a look at the cat API : you can get the list of available parameters via http://localhost:9200/_cat/indices?help

To get the creation date of your indexes, you would use creation.date (or creation.date.string). For example, use

http://localhost:9200/_cat/indices?h=h,s,i,id,p,r,dc,dd,ss,creation.date.string 

For full header names:

http://localhost:9200/_cat/indices?h=health,status,index,id,pri,rep,docs.count,docs.deleted,store.size,creation.date.string&v= 
like image 81
nikoshr Avatar answered Sep 18 '22 20:09

nikoshr