Skip to content

[ResponseOps][Maintenance Window] Maintenance Window does not apply when using wildcard via Query DSL#256622

Merged
georgianaonoleata1904 merged 16 commits intoelastic:mainfrom
georgianaonoleata1904:maintenance-window-wildcard-issue
Mar 24, 2026
Merged

[ResponseOps][Maintenance Window] Maintenance Window does not apply when using wildcard via Query DSL#256622
georgianaonoleata1904 merged 16 commits intoelastic:mainfrom
georgianaonoleata1904:maintenance-window-wildcard-issue

Conversation

@georgianaonoleata1904
Copy link
Copy Markdown
Contributor

@georgianaonoleata1904 georgianaonoleata1904 commented Mar 9, 2026

Closes #252656
Closes #253857

Summary

Fixed MW alert filtering when using wildcards.

  • buildEsQuery() was called with undefined for the index pattern param so the KQL compiler couldn't determine field types
  • fix: pass a DataViewBase with esTypes from alertFieldMap, enabling correct wildcard handling for keyword fields

@georgianaonoleata1904 georgianaonoleata1904 self-assigned this Mar 9, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (4)
  • reviewer:coderabbit
  • Team:Search
  • Team:Operations
  • Team:QA

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 364535f9-3155-4acc-994c-63a1e01a86c4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@georgianaonoleata1904 georgianaonoleata1904 added Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.4.0 v9.2.7 v9.3.2 bug Fixes for quality problems that affect the customer experience labels Mar 9, 2026
@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as ready for review March 10, 2026 08:45
@georgianaonoleata1904 georgianaonoleata1904 requested review from a team as code owners March 10, 2026 08:45
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

Left a few comments, haven't done a complete review yet ...


it.each([
['test*', 'test*'],
['test rule*', 'test rule*'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We also need to figure out, in the KQL prompter, what they return when you don't use the KQL controls, but click the "Use Query DSL" and enter in your own DSL. And then test that here as well.

It's not clear to me why using Query DSL in the KQL picker would need an index pattern, so I was wondering if there was something different about using the Use Query DSL option, that we weren't handling correctrly.

Copy link
Copy Markdown
Contributor Author

@georgianaonoleata1904 georgianaonoleata1904 Mar 17, 2026

Choose a reason for hiding this comment

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

When the user clicks "Edit as Query DSL", the raw DSL is stored in filter.query and passed through scope.alerting.filters. On the server side, buildEsQuery() returns filter.query as is via translateToQuery(), this means no index pattern needed. You're right that Query DSL doesn't need one.

The getAlertsDataViewBase() only affects the KQL part, when the system needs field types to generate the wildcard queries. I'll add a test confirming Query DSL wildcards pass through unchanged.

* 2.0.
*/

import { alertFieldMap } from '@kbn/alerts-as-data-utils';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We probably already have some code to generate mappings from the alertFieldMap, since someone has to create the mappings :-). We should find that and reuse it - exporting it or whatever to make it available here.

I'm not sure if different alert indices have different mappings, but I'm 98% sure they can, so I'm not sure this approach covers 100% of the cases. I feel like we may need to have the code that evaluates the MW get passed the mappings. So the alerting code would figure out what alerting indices were going to be queried over, and pass them into the evaluator.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is mappingFromFieldMap() but looks like it generates es index mappings (nested) not a DataViewBase (flat field with esTypes). I don't think we can reuse it directly, but maybe I'm wrong.

However, looks like rule types can register custom fields using IRuleTypeAlerts.mappings.fieldMap. The fix adding getAlertsDataViewBase covers the base alertFieldMap.

I'll look into adding combined maps for this edge case.

Copy link
Copy Markdown
Contributor Author

@georgianaonoleata1904 georgianaonoleata1904 Mar 19, 2026

Choose a reason for hiding this comment

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

Hey @pmuellr , I did a some investigation and for combined maps: we could aggregate all registered IRuleTypeAlerts.mappings.fieldMap entries and merge them with alertFieldMap, but a MW is saved once and can apply to many rule types. I THINK that the correct fix would be to apply your suggestion: generate DSL at evaluation time when the exact rule type is known, but I also think that this changes the scope.alerting contract and feels like a larger follow up.
For now, getAlertsDataViewBase() covers the standard alertFieldMap fields. Maybe we can ship the fix as is and open a follow up issue to track the mappings at evaluation time approach. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ya, even if we just handle all the standard fields, that should be a great first step. Assuming we do that, let's open an issue to later deal with the custom fields. I suspect the easiest thing to do will be to get the fields from ES based on the index pattern we use, which could be a little expensive, so will be tricky to get right :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opened the follow up issue: #259076
Thanks!

Copy link
Copy Markdown
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM, but would like a function test. If we're in a crunch for time, I thinking adding one in a followup PR would be fine, but hopefully we have some existing MW FT we can adapt easily ...

@georgianaonoleata1904 georgianaonoleata1904 merged commit f26f09a into elastic:main Mar 24, 2026
24 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2, 9.3

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.2 Backport failed because of merge conflicts
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- Update dependency @moonrepo/cli to v2 (main) (#256118)

Manual backport

To create the backport manually run:

node scripts/backport --pr 256622

Questions ?

Please refer to the Backport tool documentation

georgianaonoleata1904 added a commit to georgianaonoleata1904/kibana that referenced this pull request Mar 24, 2026
…hen using wildcard via Query DSL (elastic#256622)

Closes elastic#252656
Closes elastic#253857

## Summary

Fixed MW alert filtering when using wildcards.
- `buildEsQuery()` was called with `undefined` for the index pattern
param so the KQL compiler couldn't determine field types
- fix: pass a `DataViewBase` with `esTypes` from `alertFieldMap`,
enabling correct wildcard handling for keyword fields

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit f26f09a)

# Conflicts:
#	x-pack/platform/plugins/shared/maintenance_windows/moon.yml
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/create/create_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/create/create_maintenance_window.ts
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/update/update_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/maintenance_windows/server/application/methods/update/update_maintenance_window.ts
#	x-pack/platform/plugins/shared/maintenance_windows/tsconfig.json
@georgianaonoleata1904
Copy link
Copy Markdown
Contributor Author

💔 Some backports could not be created

Status Branch Result
9.3
9.2 An unhandled error occurred. Please see the logs for details

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 256622

Questions ?

Please refer to the Backport tool documentation

georgianaonoleata1904 added a commit to georgianaonoleata1904/kibana that referenced this pull request Mar 24, 2026
…hen using wildcard via Query DSL (elastic#256622)

Closes elastic#252656
Closes elastic#253857

## Summary

Fixed MW alert filtering when using wildcards.
- `buildEsQuery()` was called with `undefined` for the index pattern
param so the KQL compiler couldn't determine field types
- fix: pass a `DataViewBase` with `esTypes` from `alertFieldMap`,
enabling correct wildcard handling for keyword fields

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit f26f09a)

# Conflicts:
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.ts
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.ts
#	x-pack/platform/plugins/shared/maintenance_windows/moon.yml
#	x-pack/platform/plugins/shared/maintenance_windows/tsconfig.json
georgianaonoleata1904 added a commit to georgianaonoleata1904/kibana that referenced this pull request Mar 24, 2026
…hen using wildcard via Query DSL (elastic#256622)

Closes elastic#252656
Closes elastic#253857

## Summary

Fixed MW alert filtering when using wildcards.
- `buildEsQuery()` was called with `undefined` for the index pattern
param so the KQL compiler couldn't determine field types
- fix: pass a `DataViewBase` with `esTypes` from `alertFieldMap`,
enabling correct wildcard handling for keyword fields

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit f26f09a)

# Conflicts:
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.ts
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.test.ts
#	x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/update/update_maintenance_window.ts
#	x-pack/platform/plugins/shared/maintenance_windows/moon.yml
#	x-pack/platform/plugins/shared/maintenance_windows/tsconfig.json
@georgianaonoleata1904
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.2

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

Questions ?

Please refer to the Backport tool documentation

jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
…hen using wildcard via Query DSL (elastic#256622)

Closes elastic#252656
Closes elastic#253857

## Summary

Fixed MW alert filtering when using wildcards. 
- `buildEsQuery()` was called with `undefined` for the index pattern
param so the KQL compiler couldn't determine field types
- fix: pass a `DataViewBase` with `esTypes` from `alertFieldMap`,
enabling correct wildcard handling for keyword fields

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 26, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @georgianaonoleata1904

5 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @georgianaonoleata1904

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @georgianaonoleata1904

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @georgianaonoleata1904

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @georgianaonoleata1904

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @georgianaonoleata1904

georgianaonoleata1904 added a commit that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (#259517)

Closes #259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: #256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @georgianaonoleata1904

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
georgianaonoleata1904 added a commit that referenced this pull request Apr 6, 2026
…pply when using wildcard via Query DSL (#256622) (#259307)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[ResponseOps][Maintenance Window] Maintenance Window does not apply
when using wildcard via Query DSL
(#256622)](#256622)

<!--- Backport version: 11.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Georgiana-Andreea
Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2026-03-24T08:58:55Z","message":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL (#256622)\n\nCloses
https://github.com/elastic/kibana/issues/252656\nCloses
https://github.com/elastic/kibana/issues/253857\n\n## Summary\n\nFixed
MW alert filtering when using wildcards. \n- `buildEsQuery()` was called
with `undefined` for the index pattern\nparam so the KQL compiler
couldn't determine field types\n- fix: pass a `DataViewBase` with
`esTypes` from `alertFieldMap`,\nenabling correct wildcard handling for
keyword fields\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f26f09ae13ef81d02a7a5be0a1e76390330db4d2","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.4.0","v9.3.3","v9.2.8"],"title":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL","number":256622,"url":"https://github.com/elastic/kibana/pull/256622","mergeCommit":{"message":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL (#256622)\n\nCloses
https://github.com/elastic/kibana/issues/252656\nCloses
https://github.com/elastic/kibana/issues/253857\n\n## Summary\n\nFixed
MW alert filtering when using wildcards. \n- `buildEsQuery()` was called
with `undefined` for the index pattern\nparam so the KQL compiler
couldn't determine field types\n- fix: pass a `DataViewBase` with
`esTypes` from `alertFieldMap`,\nenabling correct wildcard handling for
keyword fields\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f26f09ae13ef81d02a7a5be0a1e76390330db4d2"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/256622","number":256622,"mergeCommit":{"message":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL (#256622)\n\nCloses
https://github.com/elastic/kibana/issues/252656\nCloses
https://github.com/elastic/kibana/issues/253857\n\n## Summary\n\nFixed
MW alert filtering when using wildcards. \n- `buildEsQuery()` was called
with `undefined` for the index pattern\nparam so the KQL compiler
couldn't determine field types\n- fix: pass a `DataViewBase` with
`esTypes` from `alertFieldMap`,\nenabling correct wildcard handling for
keyword fields\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f26f09ae13ef81d02a7a5be0a1e76390330db4d2"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/259303","number":259303,"state":"OPEN"},{"branch":"9.2","label":"v9.2.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
georgianaonoleata1904 added a commit that referenced this pull request Apr 6, 2026
…pply when using wildcard via Query DSL (#256622) (#259303)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[ResponseOps][Maintenance Window] Maintenance Window does not apply
when using wildcard via Query DSL
(#256622)](#256622)

<!--- Backport version: 11.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Georgiana-Andreea
Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2026-03-24T08:58:55Z","message":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL (#256622)\n\nCloses
https://github.com/elastic/kibana/issues/252656\nCloses
https://github.com/elastic/kibana/issues/253857\n\n## Summary\n\nFixed
MW alert filtering when using wildcards. \n- `buildEsQuery()` was called
with `undefined` for the index pattern\nparam so the KQL compiler
couldn't determine field types\n- fix: pass a `DataViewBase` with
`esTypes` from `alertFieldMap`,\nenabling correct wildcard handling for
keyword fields\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f26f09ae13ef81d02a7a5be0a1e76390330db4d2","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.4.0","v9.3.3","v9.2.8"],"title":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL","number":256622,"url":"https://github.com/elastic/kibana/pull/256622","mergeCommit":{"message":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL (#256622)\n\nCloses
https://github.com/elastic/kibana/issues/252656\nCloses
https://github.com/elastic/kibana/issues/253857\n\n## Summary\n\nFixed
MW alert filtering when using wildcards. \n- `buildEsQuery()` was called
with `undefined` for the index pattern\nparam so the KQL compiler
couldn't determine field types\n- fix: pass a `DataViewBase` with
`esTypes` from `alertFieldMap`,\nenabling correct wildcard handling for
keyword fields\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f26f09ae13ef81d02a7a5be0a1e76390330db4d2"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/256622","number":256622,"mergeCommit":{"message":"[ResponseOps][Maintenance
Window] Maintenance Window does not apply when using wildcard via Query
DSL (#256622)\n\nCloses
https://github.com/elastic/kibana/issues/252656\nCloses
https://github.com/elastic/kibana/issues/253857\n\n## Summary\n\nFixed
MW alert filtering when using wildcards. \n- `buildEsQuery()` was called
with `undefined` for the index pattern\nparam so the KQL compiler
couldn't determine field types\n- fix: pass a `DataViewBase` with
`esTypes` from `alertFieldMap`,\nenabling correct wildcard handling for
keyword fields\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f26f09ae13ef81d02a7a5be0a1e76390330db4d2"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 6, 2026
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 bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.2.8 v9.3.3 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Alerting] Maintenance window alert filtering not passing index mappings Maintenance Window does not apply when using wildcard via Query DSL

5 participants