You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the bug?
I am receiving the following error message:
{"level":"INFO","location":"create_analytics:130","message":"HTTP Status Code: 500","timestamp":"2023-10-25 18:38:24,972+0000","service":"service_undefined","xray_trace_id":"1-6539609d-29663438314d189b5ed560a4"}
{"level":"INFO","location":"create_analytics:131","message":{"error":{"root_cause":[{"type":"security_analytics_exception","reason":"Failed to get write index for queryIndex alias:.opensearch-sap-cloudtrail-detectors-queries"}],"type":"security_analytics_exception","reason":"Failed to get write index for queryIndex alias:.opensearch-sap-cloudtrail-detectors-queries","caused_by":{"type":"exception","reason":"org.opensearch.alerting.util.AlertingException: Failed to get write index for queryIndex alias:.opensearch-sap-cloudtrail-detectors-queries"}},"status":500},"timestamp":"2023-10-25 18:38:24,972+0000","service":"service_undefined","xray_trace_id":"1-6539609d-29663438314d189b5ed560a4"}
How can one reproduce the bug?
Steps to reproduce the behavior:
Code:
def create_analytics(os_endpoint_url, os_pass):
analytic_dir = "os_configuration_templates/security_analytics"
url = f"{os_endpoint_url}/_plugins/_security_analytics/detectors"
for analyticBody in os.listdir(analytic_dir):
if analyticBody.endswith(".json"):
try:
with open(os.path.join(analytic_dir, analyticBody)) as f:
analytic_data = f.read()
response = requests.post(
url,
data=analytic_data,
headers={"Content-Type": "application/json"},
auth=(os.environ["MASTER_USER_NAME"], os_pass),
timeout=30,
cookies=get_cookie(os_endpoint_url, os_pass),
)
logger.info(f"Adding {analyticBody} as {url}")
if response.status_code == 200 or 201:
logger.info(
f"Analytic '{analyticBody}' uploaded successfully.",
)
logger.info(f"HTTP Status Code: {response.status_code}")
logger.info(response.text)
else:
logger.info(
f"Failed to configure analytic '{analyticBody}'.",
)
logger.info(f"HTTP Status Code: {response.status_code}")
logger.info(response.text)
except (OSError, requests.exceptions.RequestException) as e:
logger.info(
f"Error configuring '{analyticBody}': {e}",
)
I am not able to reproduce the issue when creating a detector with the provided config on a fresh cluster running from the current code.
Could you either add the OpenSearch version where you are facing this issue or try again with the latest release of OpenSearch to see if the issue still occurs?
What is the bug?
I am receiving the following error message:
How can one reproduce the bug?
Steps to reproduce the behavior:
Code:
Detector definition json:
What is the expected behavior?
I expect a detector to be created.
What is your host/environment?
Lambda Python 3.11
The text was updated successfully, but these errors were encountered: