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

[Logs UI] Creation of log threshold alerts with "matches phrase" comparator fails #71828

Closed
weltenwort opened this issue Jul 15, 2020 · 1 comment · Fixed by #71850
Closed
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.9.0
Milestone

Comments

@weltenwort
Copy link
Member

Kibana version: master as of 25d143f

Problem description

Creating a log threshold alert with "matches phrase" as the condition fails.

The request sent by the browser is

{
  "params": {
    "count": {
      "value": 75,
      "comparator": "more than"
    },
    "criteria": [
      {
        "field": "message",
        "comparator": "matches phrase",
        "value": "apache"
      }
    ],
    "timeSize": 5,
    "timeUnit": "m"
  },
  "consumer": "logs",
  "alertTypeId": "logs.alert.document.count",
  "schedule": {
    "interval": "1m"
  },
  "actions": [
    {
      "id": "b0b0e6d8-572d-4cd2-afb8-9d21dad125df",
      "actionTypeId": ".server-log",
      "group": "logs.threshold.fired",
      "params": {
        "level": "info",
        "message": "{{#context.group}}{{context.group}} - {{/context.group}}{{context.matchingDocuments}} log entries have matched the following conditions: {{context.conditions}}"
      }
    }
  ],
  "tags": [],
  "name": "Test Log Alert"
}

The response is a 400 - Bad Request with the following message:

params invalid: [criteria.0.comparator]: types that failed validation:- [criteria.0.comparator.0]: expected value to equal [more than]- [criteria.0.comparator.1]: expected value to equal [less than]- [criteria.0.comparator.2]: expected value to equal [more than or equals]- [criteria.0.comparator.3]: expected value to equal [less than or equals]- [criteria.0.comparator.4]: expected value to equal [equals]- [criteria.0.comparator.5]: expected value to equal [does not equal]- [criteria.0.comparator.6]: expected value to equal [matches]- [criteria.0.comparator.7]: expected value to equal [does not match]

Steps to reproduce

  1. Navigate to the Logs UI.
  2. Open the "Create Alert" flyout.
  3. Enter a name for the alert.
  4. Change the alert condition to "MATCHES PHRASE".
    image
  5. Create the alert.
  6. Observe the error message.

Context

The response looks like a kbn-config-schema validation error. My initial guess would be that the schema defined at

comparator: schema.oneOf([
schema.literal(Comparator.GT),
schema.literal(Comparator.LT),
schema.literal(Comparator.GT_OR_EQ),
schema.literal(Comparator.LT_OR_EQ),
schema.literal(Comparator.EQ),
schema.literal(Comparator.NOT_EQ),
schema.literal(Comparator.MATCH),
schema.literal(Comparator.NOT_MATCH),
]),
is incomplete.

@weltenwort weltenwort added bug Fixes for quality problems that affect the customer experience Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.9.0 labels Jul 15, 2020
@weltenwort weltenwort added this to the Logs UI 7.9 milestone Jul 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.9.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants