From 1954d868d15667c114752e942e2d3706bdcda850 Mon Sep 17 00:00:00 2001 From: Zawadi Done Date: Tue, 9 Jul 2024 17:01:28 +0200 Subject: [PATCH] Index alias support for adjusting comments (#23) --- timesketch/api/v1/resources/event.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/timesketch/api/v1/resources/event.py b/timesketch/api/v1/resources/event.py index 832f9bcd5d..03c75db9da 100644 --- a/timesketch/api/v1/resources/event.py +++ b/timesketch/api/v1/resources/event.py @@ -813,6 +813,7 @@ def post(self, sketch_id): for _event in events: searchindex_id = _event["_index"] + # In case the index is part of an alias index, the alias name is used as searchindex searchindex_id, searchindex_name = self.datastore.resolve_index_alias( searchindex_id @@ -931,6 +932,9 @@ def put(self, sketch_id): # only one event will be in the event list for _event in events: searchindex_id = _event["_index"] + + # In case the index is part of an alias index, the alias name is used as searchindex + searchindex_id, _ = self.datastore.resolve_index_alias(searchindex_id) searchindex = SearchIndex.query.filter_by(index_name=searchindex_id).first() event_id = _event["_id"]