-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Configuring Anomaly Detector #162
Comments
[Triage] |
Hello @prudhvigodithi - I personally haven't tried using the OpenSearch API. I just noticed a difference in what shows up in the UI when you point and click versus when you use the Terraform provider ( terraform {
required_providers {
opensearch = {
source = "opensearch-project/opensearch"
version = "2.2.0"
}
}
} Complete Terraform code from the snippet I posted above: resource "opensearch_anomaly_detection" "this" {
body = <<EOF
{
"name": "my-awesome-detector",
"description": "An anomaly detector for ingress logs created via Terraform.",
"time_field": "@timestamp",
"result_index" : "opensearch-ad-plugin-result-my-awesome-detector",
"indices": [
"*ingress*"
],
"feature_attributes": [
{
"feature_name": "count_client_ip",
"feature_enabled": true,
"aggregation_query": {
"count_client_ip": {
"value_count": {
"field": "client_ip.keyword"
}
}
}
}
],
"filter_query": {
"bool": {
"filter": [
{
"range": {
"value": {
"gt": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"detection_interval": {
"period": {
"interval": 10,
"unit": "Minutes"
}
},
"window_delay": {
"period": {
"interval": 1,
"unit": "Minutes"
}
}
}
EOF
} |
@jmurillo9 Creating an anomaly detector using
|
I'll have to give this a try. Thanks @rblcoder ! |
What is the bug?
I am trying to configure an anomaly detector using the latest provider version (
v2.2.0
). When I am defining a feature, I can only seem to get my code to work usingaggregation_query
which results in a custom expression to show up in the UI.but... when I create a feature manually, I can have the feature show up like so:
I have been trying various variations of utilizing:
How can one reproduce the bug?
reference Terraform docs regarding the resource in question, copy example snippet and try to deploy.
What is the expected behavior?
The features show up the same in the UI. There seems to be two distinct options to pick from when doing this manually.
What is your host/environment?
OpenSearch_2.9
terraform v1.2.2
Do you have any additional context?
If the two variations are interchangeable, then can someone please provide a working query that I can use that would be the same as what works when doing this manually.
If someone can provide an example of how to properly add
categorical_fields
as well, that would be greatly appreciated. I cannot seem to get that to work (again because the resource is expectingaggregation_query
. I tried doing:The text was updated successfully, but these errors were encountered: