elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.76k stars 8.17k forks source link

[Metric/custom threshold] Additional context might not be included correctly depending on how the data is ingested #193779

Open maryam-saeidi opened 1 week ago

maryam-saeidi commented 1 week ago

Summary

The custom and metric threshold rules have an issue with adding additional context when the data is ingested as host.hostname: 'host1' instead of host: { hostname: 'host1' }. The log threshold rule does not have such an issue, and we need to verify this issue for other rules that have additional context.

Here is the log for these 2 cases: (code)

host.hostname: 'host1' host: { hostname: 'host1' }
Image Image

How to reproduce?

Follow these steps (slack for more info)

  1. Create an index:

    DELETE /metrics-index1
    PUT /metrics-index1
    {
      "mappings": {
        "properties": {
          "host.hostname": {
            "type": "keyword"
          },
          "host.name": {
            "type": "keyword"
          }
        }
      }
    }
  2. Ingest some data with the following format:

      {
        "@timestamp": "${date1}",
        "host.hostname": "${content1}",
        "value": ${content2}
      }
  3. Create a rule that triggers an alert based on this data and group by host.hostname

  4. Check the alert document, you should not be able to see host.name in the AAD document.

Acceptance criteria

Thanks @bsturg for reporting this!

elasticmachine commented 1 week ago

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)