File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,24 @@ function generate_rollover_template() {
84
84
# Loads the index templates for the rollover policy to the indexer.
85
85
# ########################################################################
86
86
function load_templates() {
87
- # Note: the wazuh-template.json could also be loaded here.
87
+ # Load wazuh-template.json, needed for initial indices creation.
88
+ local wazuh_template_path=" /etc/wazuh-indexer/wazuh-template.json"
89
+ echo " Will create 'wazuh' index template"
90
+ if [ -f $wazuh_template_path ]; then
91
+ cat $wazuh_template_path |
92
+ if ! curl -s -k ${C_AUTH} \
93
+ -X PUT " ${INDEXER_URL} /_template/wazuh" \
94
+ -o " ${LOG_FILE} " --create-dirs \
95
+ -H ' Content-Type: application/json' -d @-; then
96
+ echo " ERROR: 'wazuh' template creation failed"
97
+ exit 1
98
+ else
99
+ echo " SUCC: 'wazuh' template created or updated"
100
+ fi
101
+ else
102
+ echo " ERROR: $wazuh_template_path not found"
103
+ fi
104
+
88
105
echo " Will create index templates to configure the alias"
89
106
for alias in " ${aliases[@]} " ; do
90
107
generate_rollover_template " ${alias} " |
You can’t perform that action at this time.
0 commit comments