Created
September 16, 2019 20:00
-
-
Save pmuellr/0069605d0ee5f954a1636db1aef5e79a to your computer and use it in GitHub Desktop.
commands for Kibana console to play with ilm/rollover/aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE _ilm/policy/event_log_policy | |
DELETE _template/event_log_template | |
DELETE event-log-000001 | |
DELETE event-log-000002 | |
PUT _ilm/policy/event_log_policy | |
{ | |
"policy": { | |
"phases": { | |
"hot": { | |
"actions": { | |
"rollover": { | |
"max_docs": "1" | |
} | |
} | |
} | |
} | |
} | |
} | |
PUT _template/event_log_template | |
{ | |
"index_patterns": ["event-log-*"], | |
"settings": { | |
"number_of_shards": 1, | |
"number_of_replicas": 1, | |
"index.lifecycle.name": "event_log_policy", | |
"index.lifecycle.rollover_alias": "event-log" | |
} | |
} | |
PUT event-log-000001 | |
{ | |
"aliases": { | |
"event-log": { | |
"is_write_index": true | |
} | |
} | |
} | |
POST event-log/_doc/ | |
{ | |
"message": "a dummy entry 1" | |
} | |
POST event-log/_refresh | |
POST /event-log/_rollover | |
{ | |
"conditions": { | |
"max_docs": "1" | |
} | |
} | |
POST event-log/_doc/ | |
{ | |
"message": "a dummy entry 2" | |
} | |
GET event-log/_search/ | |
GET event-log | |
GET event-log-000001 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment