mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
get 200 from es before collecting metrics
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||
# Elastic License 2.0.
|
||||
|
||||
if curl -K /etc/telegraf/elasticsearch.config -s -k -L "https://localhost:9200/" -w "%{http_code}" -o /dev/null | grep -q '200'; then
|
||||
|
||||
DATASTREAM_INFO=$(curl -K /etc/telegraf/elasticsearch.config -s -k -L "https://localhost:9200/_data_stream?format=json")
|
||||
INDICES=$(curl -K /etc/telegraf/elasticsearch.config -s -k -L "https://localhost:9200/_cat/indices?h=index,store.size&bytes=b&s=index:asc&format=json")
|
||||
INDICES_WITH_SIZE=()
|
||||
@@ -39,3 +41,5 @@ for idxws in "${!INDICES_WITH_SIZE[@]}"; do
|
||||
done
|
||||
|
||||
echo "$measurement"
|
||||
|
||||
fi
|
||||
Reference in New Issue
Block a user