From dc258cf04332f14dff9b7b25f51741dd1b4cd8ce Mon Sep 17 00:00:00 2001 From: Wes Lambert Date: Fri, 11 Mar 2022 16:22:55 +0000 Subject: [PATCH] Load custom component templates in so-elasticsearch-templates-load --- .../tools/sbin/so-elasticsearch-templates-load | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load b/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load index f3bcaa308..f61228c3a 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load @@ -60,6 +60,15 @@ echo "Loading Security Onion component templates..." for i in *; do TEMPLATE=$(echo $i | cut -d '.' -f1); echo "$TEMPLATE"; {{ ELASTICCURL }} -k ${ELASTICSEARCH_AUTH} -s -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_component_template/$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done echo +if [ -d ${ELASTICSEARCH_TEMPLATES}/component/custom ]; then + # Load custom component templates + cd ${ELASTICSEARCH_TEMPLATES}/component/custom + + echo "Loading custom component templates..." + for i in *; do TEMPLATE=$(echo $i | cut -d '.' -f1); echo "$TEMPLATE"; curl -K /opt/so/conf/elasticsearch/curl.config -k ${ELASTICSEARCH_AUTH} -s -XPUT -L https://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_component_template/$TEMPLATE -H 'Content-Type: application/json' -d@$i 2>/dev/null; echo; done + echo +fi + # Load SO index templates cd ${ELASTICSEARCH_TEMPLATES}/index