From bc495c5514ccb7dcfc022dc3f32a53d8c4664828 Mon Sep 17 00:00:00 2001 From: shai Date: Mon, 17 Jan 2022 16:15:53 +0200 Subject: [PATCH 1/2] adding timestamp --- elasticsearch.monitoring/fetch_stats.py | 1 + 1 file changed, 1 insertion(+) diff --git a/elasticsearch.monitoring/fetch_stats.py b/elasticsearch.monitoring/fetch_stats.py index ba2fb41..490f585 100755 --- a/elasticsearch.monitoring/fetch_stats.py +++ b/elasticsearch.monitoring/fetch_stats.py @@ -259,6 +259,7 @@ def fetch_index_stats(routing_table,base_url='http://localhost:9200/',verify=Tru #logger.info("Building log for index " + index_name) index_data = { "timestamp": ts , + "@timestamp": ts , "cluster_uuid": cluster_uuid, "type": "index_stats", "created" : index_settings_ordered[index_name]['settings']['index']['creation_date'] From b36e458626242554c429dc066a8b610fed41566d Mon Sep 17 00:00:00 2001 From: shai Date: Mon, 17 Jan 2022 16:19:18 +0200 Subject: [PATCH 2/2] adding timestamp --- elasticsearch.monitoring/fetch_stats.py | 1 + 1 file changed, 1 insertion(+) diff --git a/elasticsearch.monitoring/fetch_stats.py b/elasticsearch.monitoring/fetch_stats.py index 490f585..0277eee 100755 --- a/elasticsearch.monitoring/fetch_stats.py +++ b/elasticsearch.monitoring/fetch_stats.py @@ -257,6 +257,7 @@ def fetch_index_stats(routing_table,base_url='http://localhost:9200/',verify=Tru for index_name in indices: shards = get_shard_data(routing_table_ordered[index_name]['shards']) #logger.info("Building log for index " + index_name) + # unlike other stats types, @timestamp is based on current time because there is no document timestamp index_data = { "timestamp": ts , "@timestamp": ts ,