Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit 5b6069e

Browse files
author
ashwinkumar12345
committed
incorporated more comments
1 parent a7ca587 commit 5b6069e

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

docs/ad/api.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ POST _opendistro/_anomaly_detection/detectors
249249
"description": "test historical detector",
250250
"time_field": "timestamp",
251251
"indices": [
252-
"nab_art_daily_jumpsdown"
252+
"host-cloudwatch"
253253
],
254254
"filter_query": {
255255
"match_all": {
@@ -775,7 +775,16 @@ POST _opendistro/_anomaly_detection/detectors/results/_search
775775
}
776776
```
777777

778-
In historical detectors, specify the `detector_id`:
778+
In historical detectors, specify the `detector_id`.
779+
To get the latest task:
780+
781+
#### Request
782+
783+
```json
784+
GET _opendistro/_anomaly_detection/detectors/<detector_id>?task=true
785+
```
786+
787+
To query the anomaly results with `task_id`:
779788

780789
#### Request
781790

@@ -784,8 +793,8 @@ GET _opendistro/_anomaly_detection/detectors/results/_search
784793
{
785794
"query": {
786795
"term": {
787-
"detector_id": {
788-
"value": "dZc8WncBgO2zoQoFWVBA"
796+
"task_id": {
797+
"value": "NnlV9HUBQxqfQ7vBJNzy"
789798
}
790799
}
791800
}
@@ -925,7 +934,7 @@ GET _opendistro/_anomaly_detection/detectors/results/_search
925934
## Delete detector
926935

927936
Deletes a detector based on the `detector_id`.
928-
To delete a historical detector, you need to first stop the detector.
937+
To delete a detector, you need to first stop the detector.
929938

930939
#### Request
931940

@@ -959,7 +968,8 @@ DELETE _opendistro/_anomaly_detection/detectors/<detectorId>
959968

960969
## Update detector
961970

962-
Updates a detector with any changes, including the description or adding or removing of features. You can't update a real-time detector to a historical detector or vice versa.
971+
Updates a detector with any changes, including the description or adding or removing of features.
972+
To update a detector, you need to first stop the detector.
963973

964974
#### Request
965975

@@ -1075,7 +1085,7 @@ PUT _opendistro/_anomaly_detection/detectors/<detectorId>
10751085
}
10761086
```
10771087

1078-
To update a historical detector, you need to first stop the detector.
1088+
To update a historical detector:
10791089

10801090
#### Request
10811091

docs/ad/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Setting | Default | Description
3636
`opendistro.anomaly_detection.max_primary_shards` | 10 | The maximum number of primary shards an anomaly detection index can have.
3737
`opendistro.anomaly_detection.filter_by_backend_roles` | False | When you enable the security plugin and set this to `true`, the plugin filters results based on the user's backend role(s).
3838
`opendistro.anomaly_detection.max_cache_miss_handling_per_second` | 100 | High cardinality detectors use a cache to store active models. In the event of a cache miss, the cache gets the models from the model checkpoint index. Use this setting to limit the rate of fetching models. Because the thread pool for a GET operation has a queue of 1,000, we recommend setting this value below 1,000.
39-
`opendistro.anomaly_detection.max_batch_task_per_node` | 2 | Starting a historical detector triggers a batch task. This setting is the number of batch tasks that you can run per data node. You can tune this setting from 1 to 1000. If the data nodes can't support all batch tasks, add more data nodes instead of changing this setting to a higher value.
39+
`opendistro.anomaly_detection.max_batch_task_per_node` | 2 | Starting a historical detector triggers a batch task. This setting is the number of batch tasks that you can run per data node. You can tune this setting from 1 to 1000. If the data nodes can't support all batch tasks and if you're not sure if the data nodes are capable of running more historical detectors, add more data nodes instead of changing this setting to a higher value.
4040
`opendistro.anomaly_detection.max_old_ad_task_docs_per_detector` | 10 | You can run the same historical detector many times. For each run, the anomaly detection plugin creates a new task. This setting is the number of previous tasks the plugin keeps. Set this value to at least 1 to track its last run. You can keep a maximum of 1,000 old tasks to avoid overwhelming the cluster.
4141
`opendistro.anomaly_detection.batch_task_piece_size` | 1000 | The date range for a historical task is split into smaller pieces and the anomaly detection plugin runs the task piece by piece. Each piece contains 1,000 detection intervals by default. For example, if detector interval is 1 minute and one piece is 1000 minutes, the feature data is queried every 1,000 minutes. You can change this setting from 1 to 10,000.
4242
`opendistro.anomaly_detection.batch_task_piece_interval_seconds` | 5 | Add a time interval between historical detector tasks. This interval prevents the task from consuming too much of the available resources and starving other operations like search and bulk index. You can change this setting from 1 to 600 seconds.

0 commit comments

Comments
 (0)