Skip to content

[Entity Analytics] Graph filters - correlate entities with events using euid filters#261420

Merged
kfirpeled merged 54 commits intomainfrom
siem/ea-entity-flyout-euid-filters
Apr 13, 2026
Merged

[Entity Analytics] Graph filters - correlate entities with events using euid filters#261420
kfirpeled merged 54 commits intomainfrom
siem/ea-entity-flyout-euid-filters

Conversation

@kfirpeled
Copy link
Copy Markdown
Contributor

@kfirpeled kfirpeled commented Apr 6, 2026

Summary

Closes #261357.

After migrating Graph Visualization from Entity Store v1 to v2 (EUID format), filters in the graph stopped correctly correlating entities with events. The root cause: EUID node IDs (e.g. user:admin@example.com@okta) don't match raw ECS field values in documents (e.g. user.email = admin@example.com), which broke filter and pinning operations.

This PR fixes the correlation by:

  • Making source fields dynamic and entity-type-aware: Instead of hardcoded field arrays, source fields are now derived at runtime from Entity Store definitions via euid.getEuidSourceFields(), grouped by entity type. The server embeds these fields into each graph node's sourceFields so the frontend can build correct raw-value filters.
  • Fixing the ES|QL sourceFields construction: sourceFields are now computed with CASE expressions keyed by entity type prefix, and the .target. namespace is stripped from keys before sending to the frontend.

Also, the PR adapts pinning entities replacing the old approach (extracting pinned IDs from search filters) with a dedicated pinnedEuids state in the FilterStore. When a user toggles an entity filter, the entity's EUID is pinned/unpinned.

Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

kfirpeled and others added 30 commits March 29, 2026 19:28
… entity fields inste (#260619)

<!-- Macroscope (Fix It For Me) template starts here -->
### Macroscope: _Fix It For Me_
- This PR originated from [this
comment](https://github.com/elastic/kibana/pull/260174/files#r3019970046)
in #260174.
- Since auto-merge is on, Macroscope will merge this PR after waiting
for checks to pass.
- If you'd rather not wait, you can always merge this yourself but **no
further action from you is currently needed**.
- You can also @mention Macroscope in this PR to request further
changes.

#### Activity
Currently: <!-- Macroscope (Fix It For Me) current status starts here
-->_Waiting on checks_<!-- Macroscope (Fix It For Me) current status
ends here -->

<details>
<summary>Previously</summary>

<!-- Macroscope (Fix It For Me) previous status starts here -->
- Pushed ac558bf
<!-- Macroscope (Fix It For Me) previous status ends here -->

</details>

----
<!-- Macroscope (Fix It For Me) template ends here -->

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible
markers, and the markers themselves will not be visible in the GitHub
rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's
description, Macroscope will append its summary at the bottom of the
description. -->
<!-- Macroscope's pull request summary ends here -->

Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
…lters when entityIds (#260638)

<!-- Macroscope (Fix It For Me) template starts here -->
### Macroscope: _Fix It For Me_
- This PR originated from [this
comment](https://github.com/elastic/kibana/pull/260174/files#r3020593548)
in #260174.
- Since auto-merge is on, Macroscope will merge this PR after waiting
for checks to pass.
- If you'd rather not wait, you can always merge this yourself but **no
further action from you is currently needed**.
- You can also @mention Macroscope in this PR to request further
changes.

#### Activity
Currently: <!-- Macroscope (Fix It For Me) current status starts here
-->Not merged: unstable<!-- Macroscope (Fix It For Me) current status
ends here -->

<details>
<summary>Previously</summary>

<!-- Macroscope (Fix It For Me) previous status starts here -->
- Waiting on checks
- Pushed 295b4f3
<!-- Macroscope (Fix It For Me) previous status ends here -->

</details>

----
<!-- Macroscope (Fix It For Me) template ends here -->

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible
markers, and the markers themselves will not be visible in the GitHub
rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's
description, Macroscope will append its summary at the bottom of the
description. -->
<!-- Macroscope's pull request summary ends here -->

Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
@albertoblaz albertoblaz added backport:skip This PR does not require backporting v9.4.0 labels Apr 11, 2026
@kfirpeled kfirpeled added backport:version Backport to applied version labels and removed backport:skip This PR does not require backporting labels Apr 13, 2026
Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

I feel like some of the code is duplicated and could have been potentially extracted into a reusable hook, but this is minor and can be done in a follow up PR.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 13, 2026

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #76 / Endpoint plugin @ess @serverless @skipInServerlessMKI When attempting to call an endpoint api "before all" hook in "@ess @serverless @skipInServerlessMKI When attempting to call an endpoint api"

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/cloud-security-posture-common 223 226 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.7MB 11.7MB +1.7KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
entityStore 11 23 +12
Unknown metric groups

API count

id before after diff
@kbn/cloud-security-posture-common 230 233 +3

History

@kfirpeled kfirpeled merged commit 6a78b64 into main Apr 13, 2026
19 checks passed
@kfirpeled kfirpeled deleted the siem/ea-entity-flyout-euid-filters branch April 13, 2026 19:44
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

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

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 13, 2026
…ng euid filters (elastic#261420)

## Summary

Closes elastic#261357.

After migrating Graph Visualization from Entity Store v1 to v2 (EUID
format), filters in the graph stopped correctly correlating entities
with events. The root cause: EUID node IDs (e.g.
user:admin@example.com@okta) don't match raw ECS field values in
documents (e.g. user.email = admin@example.com), which broke filter and
pinning operations.

This PR fixes the correlation by:

- Making source fields dynamic and entity-type-aware: Instead of
hardcoded field arrays, source fields are now derived at runtime from
Entity Store definitions via euid.getEuidSourceFields(), grouped by
entity type. The server embeds these fields into each graph node's
sourceFields so the frontend can build correct raw-value filters.
- Fixing the ES|QL sourceFields construction: sourceFields are now
computed with CASE expressions keyed by entity type prefix, and the
.target. namespace is stripped from keys before sending to the frontend.

Also, the PR adapts pinning entities replacing the old approach
(extracting pinned IDs from search filters) with a dedicated pinnedEuids
state in the FilterStore. When a user toggles an entity filter, the
entity's EUID is pinned/unpinned.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alberto Blázquez <alberto.blazquez@elastic.co>
Co-authored-by: Alberto Blázquez <albertoblaz@users.noreply.github.com>
(cherry picked from commit 6a78b64)
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

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

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 14, 2026
…ng euid filters (elastic#261420)

## Summary

Closes elastic#261357.

After migrating Graph Visualization from Entity Store v1 to v2 (EUID
format), filters in the graph stopped correctly correlating entities
with events. The root cause: EUID node IDs (e.g.
user:admin@example.com@okta) don't match raw ECS field values in
documents (e.g. user.email = admin@example.com), which broke filter and
pinning operations.

This PR fixes the correlation by:

- Making source fields dynamic and entity-type-aware: Instead of
hardcoded field arrays, source fields are now derived at runtime from
Entity Store definitions via euid.getEuidSourceFields(), grouped by
entity type. The server embeds these fields into each graph node's
sourceFields so the frontend can build correct raw-value filters.
- Fixing the ES|QL sourceFields construction: sourceFields are now
computed with CASE expressions keyed by entity type prefix, and the
.target. namespace is stripped from keys before sending to the frontend.

Also, the PR adapts pinning entities replacing the old approach
(extracting pinned IDs from search filters) with a dedicated pinnedEuids
state in the FilterStore. When a user toggles an entity filter, the
entity's EUID is pinned/unpinned.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alberto Blázquez <alberto.blazquez@elastic.co>
Co-authored-by: Alberto Blázquez <albertoblaz@users.noreply.github.com>
(cherry picked from commit 6a78b64)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.4

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

Questions ?

Please refer to the Backport tool documentation

tfcmarques pushed a commit to tfcmarques/kibana that referenced this pull request Apr 14, 2026
…ng euid filters (elastic#261420)

## Summary

Closes elastic#261357.

After migrating Graph Visualization from Entity Store v1 to v2 (EUID
format), filters in the graph stopped correctly correlating entities
with events. The root cause: EUID node IDs (e.g.
user:admin@example.com@okta) don't match raw ECS field values in
documents (e.g. user.email = admin@example.com), which broke filter and
pinning operations.

This PR fixes the correlation by:

- Making source fields dynamic and entity-type-aware: Instead of
hardcoded field arrays, source fields are now derived at runtime from
Entity Store definitions via euid.getEuidSourceFields(), grouped by
entity type. The server embeds these fields into each graph node's
sourceFields so the frontend can build correct raw-value filters.
- Fixing the ES|QL sourceFields construction: sourceFields are now
computed with CASE expressions keyed by entity type prefix, and the
.target. namespace is stripped from keys before sending to the frontend.

Also, the PR adapts pinning entities replacing the old approach
(extracting pinned IDs from search filters) with a dedicated pinnedEuids
state in the FilterStore. When a user toggles an entity filter, the
entity's EUID is pinned/unpinned.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alberto Blázquez <alberto.blazquez@elastic.co>
Co-authored-by: Alberto Blázquez <albertoblaz@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Apr 14, 2026
…ts using euid filters (#261420) (#262950)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Entity Analytics] Graph filters - correlate entities with events
using euid filters
(#261420)](#261420)

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

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

<!--BACKPORT [{"author":{"name":"Kfir
Peled","email":"61654899+kfirpeled@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-13T19:44:03Z","message":"[Entity
Analytics] Graph filters - correlate entities with events using euid
filters (#261420)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/261357.\n\nAfter migrating
Graph Visualization from Entity Store v1 to v2 (EUID\nformat), filters
in the graph stopped correctly correlating entities\nwith events. The
root cause: EUID node IDs (e.g.\nuser:admin@example.com@okta) don't
match raw ECS field values in\ndocuments (e.g. user.email =
admin@example.com), which broke filter and\npinning operations.\n\nThis
PR fixes the correlation by:\n\n- Making source fields dynamic and
entity-type-aware: Instead of\nhardcoded field arrays, source fields are
now derived at runtime from\nEntity Store definitions via
euid.getEuidSourceFields(), grouped by\nentity type. The server embeds
these fields into each graph node's\nsourceFields so the frontend can
build correct raw-value filters.\n- Fixing the ES|QL sourceFields
construction: sourceFields are now\ncomputed with CASE expressions keyed
by entity type prefix, and the\n.target. namespace is stripped from keys
before sending to the frontend.\n\nAlso, the PR adapts pinning entities
replacing the old approach\n(extracting pinned IDs from search filters)
with a dedicated pinnedEuids\nstate in the FilterStore. When a user
toggles an entity filter, the\nentity's EUID is pinned/unpinned.\n\n###
Checklist\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [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- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[x] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: macroscopeapp[bot]
<170038800+macroscopeapp[bot]@users.noreply.github.com>\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Alberto Blázquez <alberto.blazquez@elastic.co>\nCo-authored-by: Alberto
Blázquez
<albertoblaz@users.noreply.github.com>","sha":"6a78b641a3d00ad66258ad628b859d89a7a906ed","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:SIEM","release_note:skip","backport:version","v9.4.0","v9.5.0"],"title":"[Entity
Analytics] Graph filters - correlate entities with events using euid
filters","number":261420,"url":"https://github.com/elastic/kibana/pull/261420","mergeCommit":{"message":"[Entity
Analytics] Graph filters - correlate entities with events using euid
filters (#261420)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/261357.\n\nAfter migrating
Graph Visualization from Entity Store v1 to v2 (EUID\nformat), filters
in the graph stopped correctly correlating entities\nwith events. The
root cause: EUID node IDs (e.g.\nuser:admin@example.com@okta) don't
match raw ECS field values in\ndocuments (e.g. user.email =
admin@example.com), which broke filter and\npinning operations.\n\nThis
PR fixes the correlation by:\n\n- Making source fields dynamic and
entity-type-aware: Instead of\nhardcoded field arrays, source fields are
now derived at runtime from\nEntity Store definitions via
euid.getEuidSourceFields(), grouped by\nentity type. The server embeds
these fields into each graph node's\nsourceFields so the frontend can
build correct raw-value filters.\n- Fixing the ES|QL sourceFields
construction: sourceFields are now\ncomputed with CASE expressions keyed
by entity type prefix, and the\n.target. namespace is stripped from keys
before sending to the frontend.\n\nAlso, the PR adapts pinning entities
replacing the old approach\n(extracting pinned IDs from search filters)
with a dedicated pinnedEuids\nstate in the FilterStore. When a user
toggles an entity filter, the\nentity's EUID is pinned/unpinned.\n\n###
Checklist\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [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- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[x] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: macroscopeapp[bot]
<170038800+macroscopeapp[bot]@users.noreply.github.com>\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Alberto Blázquez <alberto.blazquez@elastic.co>\nCo-authored-by: Alberto
Blázquez
<albertoblaz@users.noreply.github.com>","sha":"6a78b641a3d00ad66258ad628b859d89a7a906ed"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/261420","number":261420,"mergeCommit":{"message":"[Entity
Analytics] Graph filters - correlate entities with events using euid
filters (#261420)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/261357.\n\nAfter migrating
Graph Visualization from Entity Store v1 to v2 (EUID\nformat), filters
in the graph stopped correctly correlating entities\nwith events. The
root cause: EUID node IDs (e.g.\nuser:admin@example.com@okta) don't
match raw ECS field values in\ndocuments (e.g. user.email =
admin@example.com), which broke filter and\npinning operations.\n\nThis
PR fixes the correlation by:\n\n- Making source fields dynamic and
entity-type-aware: Instead of\nhardcoded field arrays, source fields are
now derived at runtime from\nEntity Store definitions via
euid.getEuidSourceFields(), grouped by\nentity type. The server embeds
these fields into each graph node's\nsourceFields so the frontend can
build correct raw-value filters.\n- Fixing the ES|QL sourceFields
construction: sourceFields are now\ncomputed with CASE expressions keyed
by entity type prefix, and the\n.target. namespace is stripped from keys
before sending to the frontend.\n\nAlso, the PR adapts pinning entities
replacing the old approach\n(extracting pinned IDs from search filters)
with a dedicated pinnedEuids\nstate in the FilterStore. When a user
toggles an entity filter, the\nentity's EUID is pinned/unpinned.\n\n###
Checklist\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [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- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[x] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: macroscopeapp[bot]
<170038800+macroscopeapp[bot]@users.noreply.github.com>\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Alberto Blázquez <alberto.blazquez@elastic.co>\nCo-authored-by: Alberto
Blázquez
<albertoblaz@users.noreply.github.com>","sha":"6a78b641a3d00ad66258ad628b859d89a7a906ed"}}]}]
BACKPORT-->

Co-authored-by: Kfir Peled <61654899+kfirpeled@users.noreply.github.com>
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: Alberto Blázquez <alberto.blazquez@elastic.co>
Co-authored-by: Alberto Blázquez <albertoblaz@users.noreply.github.com>
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:SIEM v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Entity Analytics] Graph event filters – replicate EUID logic within DSL filters

5 participants