Skip to content
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

[ML] Custom rule w/ time condition specified is accepted for forbidden functions #32545

Closed
dolaru opened this issue Aug 1, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@dolaru
Copy link
Member

dolaru commented Aug 1, 2018

Description

Found in 6.4.0-BC1

According to documentation:

If your detector uses lat_long, metric, rare, or freq_rare functions, you cannot specify conditions for your rule.

If the user tries to create a job that:

  • uses one of the forbidden functions (lat_long, metric, rare or freq_rare)
  • has a custom rule specifying a condition with applies_to set to time

... the job gets created, even though it shouldn't have according to documentation.

Steps to reproduce

  1. Create a job that uses one of the forbidden functions (lat_long, metric, rare or freq_rare) and has a custom rule with a time condition:
PUT _xpack/ml/anomaly_detectors/custom_rule_forbidden_function
{
  "analysis_config": {
    "detectors": [
      {
        "function": "metric",
        "field_name": "someFieldName",
        "custom_rules": [
          {
            "actions": [
              "skip_result"
            ],
            "conditions": [
              {
                "applies_to": "time",
                "operator": "gte",
                "value": 0
              }
            ]
          }
        ]
      }
    ]
  },
  "data_description": {}
}
  1. Notice the job was created, even though it shouldn't have according to documentation.
@dolaru dolaru added >bug :ml Machine learning labels Aug 1, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

@dimitris-athanasiou
Copy link
Contributor

Indeed, conditions that apply to time are valid regardless of the function. I raised #32548 where I improve the docs and the error message to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants