mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-09 02:32:46 +01:00
Update so-elastic-clear
This commit is contained in:
@@ -50,7 +50,11 @@ done
|
|||||||
if [ $SKIP -ne 1 ]; then
|
if [ $SKIP -ne 1 ]; then
|
||||||
# List indices
|
# List indices
|
||||||
echo
|
echo
|
||||||
|
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||||
|
curl -k https://{{ NODEIP }}:9200/_cat/indices?v
|
||||||
|
{% else %}
|
||||||
curl {{ NODEIP }}:9200/_cat/indices?v
|
curl {{ NODEIP }}:9200/_cat/indices?v
|
||||||
|
{% endif %}
|
||||||
echo
|
echo
|
||||||
# Inform user we are about to delete all data
|
# Inform user we are about to delete all data
|
||||||
echo
|
echo
|
||||||
@@ -89,10 +93,18 @@ fi
|
|||||||
# Delete data
|
# Delete data
|
||||||
echo "Deleting data..."
|
echo "Deleting data..."
|
||||||
|
|
||||||
|
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||||
|
INDXS=$(curl -s -XGET -k https://{{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
||||||
|
{% else %}
|
||||||
INDXS=$(curl -s -XGET {{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
INDXS=$(curl -s -XGET {{ NODEIP }}:9200/_cat/indices?v | egrep 'logstash|elastalert|so-' | awk '{ print $3 }')
|
||||||
|
{% endif %}
|
||||||
for INDX in ${INDXS}
|
for INDX in ${INDXS}
|
||||||
do
|
do
|
||||||
|
{% if grains['role'] in ['so-node','so-heavynode'] %}
|
||||||
|
curl -XDELETE -k https://"{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
||||||
|
{% else %}
|
||||||
curl -XDELETE "{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
curl -XDELETE "{{ NODEIP }}:9200/${INDX}" > /dev/null 2>&1
|
||||||
|
{% endif %}
|
||||||
done
|
done
|
||||||
|
|
||||||
#Start Logstash/Filebeat
|
#Start Logstash/Filebeat
|
||||||
|
|||||||
Reference in New Issue
Block a user