Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
disable replicas for .kibana and elastalert indices
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Feb 1, 2018
1 parent c5f68c4 commit eb68c4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 9 additions & 5 deletions usr/sbin/so-elastic-configure-elastalert
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ if [ ${ELASTALERT_ENABLED} = "yes" ]; then

header "Configuring ElastAlert"

# commenting out for now
# if ! curl -s -XGET http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/${ELASTALERT_INDEX} | grep -q "no such index"; then
# curl -s -XDELETE http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/${ELASTALERT_INDEX}
# fi
# curl -s -XPUT http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/elastalert -H'Content-Type: application/json' -d'{"index_patterns" : "elastalert*", "settings": { "number_of_shards" : 1, "number_of_replicas" : 0 }, "mappings" : { "search": {"properties": {"hits": {"type": "integer"}, "version": {"type": "integer"}, "match_body.source_ip": {"type": "ip"}, "match_body.destination_ip": {"type": "ip"}}}}}' > /dev/null && echo && echo "Template configured for ElastAlert." && echo "Done!"
# commenting out for now
#if ! curl -s -XGET http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/${ELASTALERT_INDEX} | grep -q "no such index"; then
# curl -s -XDELETE http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/${ELASTALERT_INDEX}
#fi
#curl -s -XPUT http://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/elastalert -H'Content-Type: application/json' -d'{"index_patterns" : "elastalert*", "settings": { "number_of_shards" : 1, "number_of_replicas" : 0 }, "mappings" : { "search": {"properties": {"hits": {"type": "integer"}, "version": {"type": "integer"}, "match_body.source_ip": {"type": "ip"}, "match_body.destination_ip": {"type": "ip"}}}}}' > /dev/null && echo && echo "Template configured for ElastAlert." && echo "Done!"

curl -s -XPUT "${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/elastalert*/_settings" \
-H 'Content-Type: application/json' \
-d'{"index" : {"number_of_replicas" : 0}}'

else
echo "ElastAlert disabled, so not configuring..."
Expand Down
4 changes: 4 additions & 0 deletions usr/sbin/so-elastic-configure-kibana-config
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ else
-d'{"index_patterns" : ".kibana", "settings": { "number_of_shards" : 1, "number_of_replicas" : 0 }, "mappings" : { "search": {"properties": {"hits": {"type": "integer"}, "version": {"type": "integer"}}}}}'
echo

curl -s -XPUT "${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/.kibana/_settings" \
-H 'Content-Type: application/json' \
-d'{"index" : {"number_of_replicas" : 0}}'

# Finally, update KIBANA_VERSION in securityonion.conf to reflect the current Kibana version
echo
echo "Updating /etc/nsm/securityonion.conf with correct Kibana version ($KIBANA_VERSION)..."
Expand Down

0 comments on commit eb68c4a

Please sign in to comment.