Skip to content

Commit 924f0bd

Browse files
committed
[DOCS] Updates custom rules example (elastic#52731)
1 parent 528e77c commit 924f0bd

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

docs/reference/ml/anomaly-detection/detector-custom-rules.asciidoc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ of following its default behavior. To specify the _when_ a rule uses
1010
a `scope` and `conditions`. You can think of `scope` as the categorical
1111
specification of a rule, while `conditions` are the numerical part.
1212
A rule can have a scope, one or more conditions, or a combination of
13-
scope and conditions.
14-
15-
Let us see how those can be configured by examples.
13+
scope and conditions. For the full list of specification details, see the
14+
{ref}/ml-put-job.html#put-customrules[`custom_rules` object] in the create
15+
{anomaly-jobs} API.
1616

17+
[[ml-custom-rules-scope]]
1718
==== Specifying custom rule scope
1819

1920
Let us assume we are configuring an {anomaly-job} in order to detect DNS data
@@ -29,7 +30,8 @@ to achieve this.
2930
First, we need to create a list of our safe domains. Those lists are called
3031
_filters_ in {ml}. Filters can be shared across {anomaly-jobs}.
3132

32-
We create our filter using the {ref}/ml-put-filter.html[put filter API]:
33+
You can create a filter in **Anomaly Detection > Settings > Filter Lists** in
34+
{kib} or by using the {ref}/ml-put-filter.html[put filter API]:
3335

3436
[source,console]
3537
----------------------------------
@@ -42,7 +44,7 @@ PUT _ml/filters/safe_domains
4244
// TEST[skip:needs-licence]
4345

4446
Now, we can create our {anomaly-job} specifying a scope that uses the
45-
`safe_domains` filter for the `highest_registered_domain` field:
47+
`safe_domains` filter for the `highest_registered_domain` field:
4648

4749
[source,console]
4850
----------------------------------
@@ -73,7 +75,8 @@ PUT _ml/anomaly_detectors/dns_exfiltration_with_rule
7375
// TEST[skip:needs-licence]
7476

7577
As time advances and we see more data and more results, we might encounter new
76-
domains that we want to add in the filter. We can do that by using the
78+
domains that we want to add in the filter. We can do that in the
79+
**Anomaly Detection > Settings > Filter Lists** in {kib} or by using the
7780
{ref}/ml-update-filter.html[update filter API]:
7881

7982
[source,console]
@@ -127,6 +130,7 @@ PUT _ml/anomaly_detectors/scoping_multiple_fields
127130
Such a detector will skip results when the values of all 3 scoped fields
128131
are included in the referenced filters.
129132

133+
[[ml-custom-rules-conditions]]
130134
==== Specifying custom rule conditions
131135

132136
Imagine a detector that looks for anomalies in CPU utilization.
@@ -206,16 +210,18 @@ PUT _ml/anomaly_detectors/rule_with_range
206210
----------------------------------
207211
// TEST[skip:needs-licence]
208212

209-
==== Custom rules in the life-cycle of a job
213+
[[ml-custom-rules-lifecycle]]
214+
==== Custom rules in the lifecycle of a job
210215

211216
Custom rules only affect results created after the rules were applied.
212217
Let us imagine that we have configured an {anomaly-job} and it has been running
213218
for some time. After observing its results we decide that we can employ
214219
rules in order to get rid of some uninteresting results. We can use
215220
the {ref}/ml-update-job.html[update {anomaly-job} API] to do so. However, the
216221
rule we added will only be in effect for any results created from the moment we
217-
added the rule onwards. Past results will remain unaffected.
222+
added the rule onwards. Past results will remain unaffected.
218223

224+
[[ml-custom-rules-filtering]]
219225
==== Using custom rules vs. filtering data
220226

221227
It might appear like using rules is just another way of filtering the data

0 commit comments

Comments
 (0)