mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 22:44:17 +02:00
- dont show ccr status if license insufficient - add automated tests - fix config loading - fix search output - fix `license show` panics - fix `ilm show` completion - print ask passwd prompt to stderr
97 lines
2.5 KiB
YAML
97 lines
2.5 KiB
YAML
#
|
|
# this is a mosscap action file, see: https://codeberg.org/scip/mosscap
|
|
vars:
|
|
esctl: ../esctl -c cluster.yaml
|
|
|
|
actions:
|
|
wait: |
|
|
sleep [[.time]]
|
|
|
|
docker_wait: |
|
|
for i in {1..20}; do
|
|
count=$(docker ps | grep healthy | wc -l)
|
|
if test $count -eq 3; then
|
|
echo "all containers are healthy"
|
|
exit
|
|
fi
|
|
sleep 5s
|
|
done
|
|
|
|
echo "not all containers are healthy"
|
|
docker ps
|
|
|
|
cluster_ls: |
|
|
[[.esctl]] cluster ls | grep -E domdoc.*reachable.*yes
|
|
|
|
cluster_status: |
|
|
[[.esctl]] cluster status | grep green
|
|
|
|
create_ilm: |
|
|
[[.esctl]] ilm create --hot-rollover-max-age 7d \
|
|
--hot-rollover-max-primary-shard-size 25g \
|
|
--warm-min-age 0 \
|
|
--delete-min-age 14d [[.policy]]
|
|
|
|
describe_ilm: |
|
|
[[.esctl]] ilm show [[.policy]] -t | grep -E "rollover when storage > 25g"
|
|
|
|
create_index_template: |
|
|
[[.esctl]] index template create [[.index]] -i [[.index]] \
|
|
-s number_of_shards:3 \
|
|
-s index.sort.field:@timestamp \
|
|
-r 1m --ilm-policy [[.policy]] \
|
|
user:keyword message:text @timestamp:date
|
|
|
|
describe_index_template: |
|
|
[[.esctl]] index template show [[.index]] | grep -E "index.sort.field.*@timestamp"
|
|
|
|
create_index: |
|
|
[[.esctl]] index create -s 2 -r 2 [[.index]]
|
|
|
|
describe_index: |
|
|
[[.esctl]] index show [[.index]] | grep -E "fields.*@timestamp"
|
|
|
|
index_ls: |
|
|
[[.esctl]] index ls | grep [[.index]]
|
|
|
|
index_template_rm: |
|
|
[[.esctl]] index template rm [[.index]]
|
|
|
|
index_rm: |
|
|
[[.esctl]] index rm [[.index]]
|
|
|
|
timestamp: |
|
|
date --iso-8601=second
|
|
|
|
date: |
|
|
date +%Y-%m-%d
|
|
|
|
doc_add: |
|
|
[[.esctl]] doc add -i [[.index]] '{"user": "[[.user]]", "message":"[[.message]]", "@timestamp":"[[.ts]]"}'
|
|
|
|
search_any: |
|
|
[[.esctl]] search -i [[.index]] -l 1 | jq .source.message
|
|
|
|
search_date: |
|
|
[[.esctl]] search -i [[.index]] -l 1 | jq '.source."@timestamp"' | grep [[.today]]
|
|
|
|
search_count: |
|
|
[[.esctl]] search -i [[.index]] -l 5000 | wc -l | grep 1000
|
|
|
|
search_content: |
|
|
[[.esctl]] search -i [[.index]] [[.content_pattern]] -l 1 | jq .source.message
|
|
|
|
search_content_and: |
|
|
[[.esctl]] search -i [[.index]] [[.content_and_pattern]] -l 1 | jq .source.message
|
|
|
|
nodes: |
|
|
[[.esctl]] node ls | grep es01
|
|
|
|
describe_node: |
|
|
[[.esctl]] node show [[.node]] | grep "Node version"
|
|
|
|
license: |
|
|
[[.esctl]] license show | grep -E "Expires.*never"
|
|
|
|
|