Check if date range is equal to
This commit is contained in:
@@ -260,8 +260,8 @@ class ElasticsearchBackend(StorageBackend):
|
||||
range_query = {
|
||||
"range": {
|
||||
"ts": {
|
||||
"gt": f"now-{rule_object.window}/d",
|
||||
"lt": "now/d",
|
||||
"gte": f"now-{rule_object.window}/d",
|
||||
"lte": "now/d",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,6 +284,8 @@ class ElasticsearchBackend(StorageBackend):
|
||||
search_query,
|
||||
index=index,
|
||||
)
|
||||
self.log.debug(f"Running scheduled query on {index}: {search_query}")
|
||||
self.log.debug(f"Response from scheduled query: {response}")
|
||||
if isinstance(response, Exception):
|
||||
error = response.info["error"]["root_cause"][0]["reason"]
|
||||
self.log.error(f"Error running scheduled search: {error}")
|
||||
|
||||
Reference in New Issue
Block a user