-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISM rollover] Policy not uploaded if there is another with the same priority #56
Comments
Improved logging [vagrant@rhel7 vagrant]$ bash indexer-ism-init.sh -i 192.168.56.10 -p +YO57pQKHvrG84qg5kFI9VNlD+Qqmmi3
Will create index templates to configure the alias
SUCC: 'wazuh-alerts' template created or updated
SUCC: 'wazuh-archives' template created or updated
Will create the 'rollover_policy' policy
INFO: policy 'rollover_policy' already exists. Skipping policy creation
Will create initial indices for the aliases
INFO: 'wazuh-alerts' write index already exists. Skipping write index creation
INFO: 'wazuh-archives' write index already exists. Skipping write index creation
SUCC: Indexer ISM initialization finished successfully |
Environment setupUsing the same Vagrantfile as in the tests, remove eveything added by the C_AUTH="-u admin:+YO57pQKHvrG84qg5kFI9VNlD+Qqmmi3"
INDEXER_URL="https://192.168.56.10:9200"
curl -k ${C_AUTH} -X DELETE "${INDEXER_URL}/_plugins/_ism/policies/rollover_policy?pretty"
curl -k ${C_AUTH} -X DELETE "${INDEXER_URL}/_template/wazuh-a*?pretty"
curl -k ${C_AUTH} -X DELETE "${INDEXER_URL}/wazuh-a*-0000*?pretty" Scenario A) Lower prio 🟢
Scenario B) Equal prio 🟢
Scenario C) Higher prio 🟢
|
Description
Related issues:
As described in #53 (comment), the script fails to upload the rollover policy if there is an existing policy with the same ID. This is not a problem itself, but the expected behavior. However, the script continues and fails silently.
The failure is that the script checks whether the policy was created by verifying the return code of the cURL command, which return 0 (the request went fine), but the operation actually failed, returning the following message:
curl -k ${C_AUTH} -X GET "${INDEXER_URL}/_plugins/_ism/policies/${POLICY_NAME}?pretty"
The script needs to be updated to check the HTTP status code, instead of cURL's return code. Probably using both is a good idea.
The text was updated successfully, but these errors were encountered: