mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-22 18:28:11 +02:00
check if template exists without --fail flag
This commit is contained in:
@@ -783,10 +783,16 @@ pin_elasticsearch_data_retention_method() {
|
|||||||
#
|
#
|
||||||
# Reference: https://github.com/elastic/kibana/issues/263048
|
# Reference: https://github.com/elastic/kibana/issues/263048
|
||||||
kibana_backport_streams_index_template() {
|
kibana_backport_streams_index_template() {
|
||||||
local current_template updated_template
|
local current_template updated_template current_template_exists
|
||||||
|
|
||||||
|
current_template_exists=$(so-elasticsearch-query "_index_template/.kibana_streams" -o /dev/null -w "%{http_code}")
|
||||||
|
if [[ "$current_template_exists" == "404" ]]; then
|
||||||
|
echo "Index template .kibana_streams does not exist, skipping backport."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if ! current_template=$(so-elasticsearch-query "_index_template/.kibana_streams" --retry 3 --retry-delay 5 --fail); then
|
if ! current_template=$(so-elasticsearch-query "_index_template/.kibana_streams" --retry 3 --retry-delay 5 --fail); then
|
||||||
echo "Index template .kibana_streams does not exist, skipping backport."
|
echo "Unable to retrieve .kibana_streams index template, skipping backport."
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user