我正在使用Elasticsearch 5.2,无法看到http://localhost:9200/_cat/indices?v和index creation time。只是想知道什么选项将显示index creation time的每个索引。
http://localhost:9200/_cat/indices?v
index creation time
uurv41yg1#
看看cat API:您可以通过http://localhost:9200/_cat/indices?help获取可用参数列表要获取索引的创建日期,可以使用creation.date(或creation.date.string)。
http://localhost:9200/_cat/indices?help
creation.date
creation.date.string
http://localhost:9200/_cat/indices?h=h,s,i,id,p,r,dc,dd,ss,creation.date.string
字符串对于完整标题名称:
http://localhost:9200/_cat/indices?h=health,status,index,id,pri,rep,docs.count,docs.deleted,store.size,creation.date.string&v=
型
lqfhib0f2#
更新2024-01,ES v 8.11。关于cat indices API的页面没有解释这一点,但说“应用程序应该使用get index API”。Rewshr的答案中的配方(使用_cat端点)仍然有效..我从ES论坛得到了an answer(那里的回答者说它没有正确的文档):
_cat
url = f'{ES_URL}/_settings?human&filter_path=*.settings.index.creation_date_string'
字符串.这确实会返回一个包含服务器上所有索引的JSON响应。注意glob:如果你愿意,你可以过滤部分索引名称。
2条答案
按热度按时间uurv41yg1#
看看cat API:您可以通过
http://localhost:9200/_cat/indices?help
获取可用参数列表要获取索引的创建日期,可以使用
creation.date
(或creation.date.string
)。字符串
对于完整标题名称:
型
lqfhib0f2#
更新2024-01,ES v 8.11。
关于cat indices API的页面没有解释这一点,但说“应用程序应该使用get index API”。
Rewshr的答案中的配方(使用
_cat
端点)仍然有效..我从ES论坛得到了an answer(那里的回答者说它没有正确的文档):
字符串
.这确实会返回一个包含服务器上所有索引的JSON响应。注意glob:如果你愿意,你可以过滤部分索引名称。