Skip to content

Comments

[ResponseOps] Update ES|QL ES query rule for context.grouping action variable#220302

Merged
doakalexi merged 1 commit intoelastic:mainfrom
doakalexi:update-esql-for-context-grouping
May 7, 2025
Merged

[ResponseOps] Update ES|QL ES query rule for context.grouping action variable#220302
doakalexi merged 1 commit intoelastic:mainfrom
doakalexi:update-esql-for-context-grouping

Conversation

@doakalexi
Copy link
Contributor

@doakalexi doakalexi commented May 6, 2025

Follow on from this PR that was merged, #213550

Summary

This PR updates the ES|QL grouping processing to work with the context.grouping action variable.

Checklist

To verify

  1. Create an ES|QL rule with grouping.
  2. In "active" and "recovered" action message, use context.grouping variable
  3. Verify that both "active" and "recovered" alert notifications contain correct information

Example if grouping on host.name and container.id:

{
  "grouping": "{{context.grouping}}",
  "host.name": "{{context.grouping.host.name}}",
  "container.id": "{{context.grouping.container.id}}"
}

@doakalexi doakalexi changed the title Updating esql for context.grouping [ResponseOps] Update ES|QL ES query rule for context.grouping action variable May 6, 2025
@doakalexi doakalexi added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.1.0 v8.19.0 Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// labels May 6, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
stackAlerts 27.4KB 27.5KB +29.0B

@doakalexi doakalexi marked this pull request as ready for review May 6, 2025 22:16
@doakalexi doakalexi requested a review from a team as a code owner May 6, 2025 22:16
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Works as described.

@doakalexi doakalexi merged commit d72c62c into elastic:main May 7, 2025
20 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/14885873959

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 7, 2025
…variable (elastic#220302)

Follow on from this PR that was merged,
elastic#213550
## Summary

This PR updates the ES|QL grouping processing to work with the
`context.grouping` action variable.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Create an ES|QL rule with grouping.
2. In "active" and "recovered" action message, use `context.grouping`
variable
3. Verify that both "active" and "recovered" alert notifications contain
correct information

Example if grouping on `host.name` and `container.id`:

```
{
  "grouping": "{{context.grouping}}",
  "host.name": "{{context.grouping.host.name}}",
  "container.id": "{{context.grouping.container.id}}"
}
```

(cherry picked from commit d72c62c)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 7, 2025
…action variable (#220302) (#220385)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ResponseOps] Update ES|QL ES query rule for context.grouping action
variable (#220302)](#220302)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alexi
Doak","email":"109488926+doakalexi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-07T14:25:41Z","message":"[ResponseOps]
Update ES|QL ES query rule for context.grouping action variable
(#220302)\n\nFollow on from this PR that was
merged,\nhttps://github.com//pull/213550\n##
Summary\n\nThis PR updates the ES|QL grouping processing to work with
the\n`context.grouping` action variable.\n\n\n### Checklist\n\n- [ ]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n\n### To
verify\n1. Create an ES|QL rule with grouping.\n2. In \"active\" and
\"recovered\" action message, use `context.grouping`\nvariable\n3.
Verify that both \"active\" and \"recovered\" alert notifications
contain\ncorrect information\n\nExample if grouping on `host.name` and
`container.id`:\n\n```\n{\n \"grouping\": \"{{context.grouping}}\",\n
\"host.name\": \"{{context.grouping.host.name}}\",\n \"container.id\":
\"{{context.grouping.container.id}}\"\n}\n```","sha":"d72c62c4c0536944fd17eb0a6ff9d83aea72ab61","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0"],"title":"[ResponseOps]
Update ES|QL ES query rule for context.grouping action
variable","number":220302,"url":"https://github.com/elastic/kibana/pull/220302","mergeCommit":{"message":"[ResponseOps]
Update ES|QL ES query rule for context.grouping action variable
(#220302)\n\nFollow on from this PR that was
merged,\nhttps://github.com//pull/213550\n##
Summary\n\nThis PR updates the ES|QL grouping processing to work with
the\n`context.grouping` action variable.\n\n\n### Checklist\n\n- [ ]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n\n### To
verify\n1. Create an ES|QL rule with grouping.\n2. In \"active\" and
\"recovered\" action message, use `context.grouping`\nvariable\n3.
Verify that both \"active\" and \"recovered\" alert notifications
contain\ncorrect information\n\nExample if grouping on `host.name` and
`container.id`:\n\n```\n{\n \"grouping\": \"{{context.grouping}}\",\n
\"host.name\": \"{{context.grouping.host.name}}\",\n \"container.id\":
\"{{context.grouping.container.id}}\"\n}\n```","sha":"d72c62c4c0536944fd17eb0a6ff9d83aea72ab61"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220302","number":220302,"mergeCommit":{"message":"[ResponseOps]
Update ES|QL ES query rule for context.grouping action variable
(#220302)\n\nFollow on from this PR that was
merged,\nhttps://github.com//pull/213550\n##
Summary\n\nThis PR updates the ES|QL grouping processing to work with
the\n`context.grouping` action variable.\n\n\n### Checklist\n\n- [ ]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n\n### To
verify\n1. Create an ES|QL rule with grouping.\n2. In \"active\" and
\"recovered\" action message, use `context.grouping`\nvariable\n3.
Verify that both \"active\" and \"recovered\" alert notifications
contain\ncorrect information\n\nExample if grouping on `host.name` and
`container.id`:\n\n```\n{\n \"grouping\": \"{{context.grouping}}\",\n
\"host.name\": \"{{context.grouping.host.name}}\",\n \"container.id\":
\"{{context.grouping.container.id}}\"\n}\n```","sha":"d72c62c4c0536944fd17eb0a6ff9d83aea72ab61"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alexi Doak <109488926+doakalexi@users.noreply.github.com>
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…variable (elastic#220302)

Follow on from this PR that was merged,
elastic#213550
## Summary

This PR updates the ES|QL grouping processing to work with the
`context.grouping` action variable.


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### To verify
1. Create an ES|QL rule with grouping.
2. In "active" and "recovered" action message, use `context.grouping`
variable
3. Verify that both "active" and "recovered" alert notifications contain
correct information

Example if grouping on `host.name` and `container.id`:

```
{
  "grouping": "{{context.grouping}}",
  "host.name": "{{context.grouping.host.name}}",
  "container.id": "{{context.grouping.container.id}}"
}
```
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…variable (elastic#220302)

Follow on from this PR that was merged,
elastic#213550
## Summary

This PR updates the ES|QL grouping processing to work with the
`context.grouping` action variable.


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### To verify
1. Create an ES|QL rule with grouping.
2. In "active" and "recovered" action message, use `context.grouping`
variable
3. Verify that both "active" and "recovered" alert notifications contain
correct information

Example if grouping on `host.name` and `container.id`:

```
{
  "grouping": "{{context.grouping}}",
  "host.name": "{{context.grouping.host.name}}",
  "container.id": "{{context.grouping.container.id}}"
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants