elastic / kibana

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

[ResponseOps][Alerting] Action variables missing in UI for Elasticsearch query rule #162080

Open lcawl opened 1 year ago

lcawl commented 1 year ago

Relates to https://github.com/elastic/kibana/issues/161126, https://github.com/elastic/kibana/issues/161710

While working on the openAPI specification details for the Elasticsearch query alerting rule in https://github.com/elastic/kibana/pull/162001, I noticed that there are some action variables that seem to be missing from the list in Kibana.

They're the ones that are shared with the index threshold rule type, for example aggField,aggType, groupBy, etc:

image

They don't appear for the Elasticsearch query rule type (no matter whether I pick the KQL/Lucence or Elasticsearch DSL option):

image

I tried a quick test of adding them to the message in my server log connector action and they seem to be valid. For example, adding {{rule.params.searchType}}{{rule.params.aggType}} yields a message like this:

[2023-07-17T12:01:23.619-07:00][INFO ][plugins.actions.server-log] Server log: Elasticsearch query rule 'es-query-dsl' is active:;;esQuery;count;...

Thus it seems they've valid, just missing from the drop-down list.

It might be as simple as updating the list of variables in the rule_type.ts file, similar to what was done in https://github.com/elastic/kibana/pull/161807 forx-pack/plugins/stack_alerts/server/rule_types/index_threshold/rule_type.ts.

elasticmachine commented 1 year ago

Pinging @elastic/response-ops (Team:ResponseOps)