【发布时间】:2020-03-10 02:13:31
【问题描述】:
我需要查询在 Elasticsearch 上创建的最新索引。
我已经形成了下面的 curl 命令
curl -X GET "localhost/_cat/indices?h=i,creation.date.string"
它返回的响应如下:
accounting 2020-03-03T02:46:29.285Z
kibana_1 2020-03-02T00:58:14.386Z
有什么方法可以以 JSON 格式返回?我一直在尝试,但无法获得 JSON 响应。
【问题讨论】:
-
在 curl 命令中尝试 -H 'Content-Type: application/json'
-
这个返回 json 格式,日期为 Unix 时间戳 curl -X GET "localhost/_all/_settings/index.creation_date"
标签: elasticsearch elasticsearch-query amazon-elasticsearch