Skip to content

Commit

Permalink
Change log file path
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRuiz7 committed Nov 15, 2023
1 parent 7634ab1 commit 65a7a95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/indexer-ism-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INDEXER_PASSWORD="admin"
INDEXER_HOSTNAME="localhost"

POLICY_NAME="rollover_policy"
LOG_FILE="/var/log/wazuh-indexer/ism-init.log"
LOG_FILE="/tmp/wazuh-indexer/ism-init.log"

INDEXER_URL="https://${INDEXER_HOSTNAME}:9200"

Expand Down Expand Up @@ -90,7 +90,7 @@ function load_templates() {
generate_rollover_template "${alias}" |
if ! curl -s -k ${C_AUTH} \
-X PUT "${INDEXER_URL}/_template/${alias}-rollover" \
-o "${LOG_FILE}" \
-o "${LOG_FILE}" --create-dirs \
-H 'Content-Type: application/json' -d @-; then
echo " ERROR: '${alias}' template creation failed"
return 1
Expand All @@ -113,7 +113,7 @@ function upload_rollover_policy() {
policy_exists=$(
curl -s -k ${C_AUTH} \
-X GET "${INDEXER_URL}/_plugins/_ism/policies/${POLICY_NAME}" \
-o "${LOG_FILE}" \
-o "${LOG_FILE}" --create-dirs \
-w "%{http_code}"
)

Expand All @@ -122,7 +122,7 @@ function upload_rollover_policy() {
policy_uploaded=$(
curl -s -k ${C_AUTH} \
-X PUT "${INDEXER_URL}/_plugins/_ism/policies/${POLICY_NAME}" \
-o "${LOG_FILE}" \
-o "${LOG_FILE}" --create-dirs \
-H 'Content-Type: application/json' \
-d "$(generate_rollover_policy)" \
-w "%{http_code}"
Expand Down Expand Up @@ -179,7 +179,7 @@ function generate_write_index_alias() {
# 1. The alias. String.
#########################################################################
function create_write_index() {
if ! curl -s -k ${C_AUTH} -o "${LOG_FILE}" \
if ! curl -s -k ${C_AUTH} -o "${LOG_FILE}" --create-dirs \
-X PUT "$INDEXER_URL/%3C${1}-4.x-%7Bnow%2Fd%7D-000001%3E" \
-H 'Content-Type: application/json' \
-d "$(generate_write_index_alias "${1}")"; then
Expand Down

0 comments on commit 65a7a95

Please sign in to comment.