検索ブログ

主に検索のことについて書いています。

Elasticsearchのcat snapshots

Elasticsearchのcat snapshotsについて記す。

公式ドキュメント cat snapshots を参考にした。

www.elastic.co

検証環境: Elasticsearch 6.0.0-rc1

cat snapshotsは特定のリポジトリに属する​​すべてのスナップショットを表示する。

bash-3.2$ curl -XGET 'localhost:9200/_cat/snapshots/repo1?v&s=id&pretty'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "repository_missing_exception",
        "reason" : "[repo1] missing"
      }
    ],
    "type" : "repository_missing_exception",
    "reason" : "[repo1] missing"
  },
  "status" : 404
}
bash-3.2$ curl -XGET 'localhost:9200/_cat/snapshots?v&pretty'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "action_request_validation_exception",
        "reason" : "Validation Failed: 1: repository is missing;"
      }
    ],
    "type" : "action_request_validation_exception",
    "reason" : "Validation Failed: 1: repository is missing;"
  },
  "status" : 400
}
bash-3.2$ curl -XGET 'localhost:9200/_cat/snapshots?help&pretty'
id                | id,snapshot          | unique snapshot                                
status            | s,status             | snapshot name                                  
start_epoch       | ste,startEpoch       | start time in seconds since 1970-01-01 00:00:00
start_time        | sti,startTime        | start time in HH:MM:SS                         
end_epoch         | ete,endEpoch         | end time in seconds since 1970-01-01 00:00:00  
end_time          | eti,endTime          | end time in HH:MM:SS                           
duration          | dur,duration         | duration                                       
indices           | i,indices            | number of indices                              
successful_shards | ss,successful_shards | number of successful shards                    
failed_shards     | fs,failed_shards     | number of failed shards                        
total_shards      | ts,total_shards      | number of total shards                         
reason            | r,reason             | reason for failures