Skip to content

[Ingest pipelines] Fix Ip location processor bug#265740

Merged
SoniaSanzV merged 5 commits intoelastic:mainfrom
SoniaSanzV:ingest_pipelines/ip_location_processor_bug
Apr 29, 2026
Merged

[Ingest pipelines] Fix Ip location processor bug#265740
SoniaSanzV merged 5 commits intoelastic:mainfrom
SoniaSanzV:ingest_pipelines/ip_location_processor_bug

Conversation

@SoniaSanzV
Copy link
Copy Markdown
Contributor

@SoniaSanzV SoniaSanzV commented Apr 27, 2026

Closes #257233

Summary

  • When an IP Location processor used a local database whose filename coincidentally matched a known managed database display name (e.g. ASN.mmdb colliding with the IPinfo "ASN" label), the pipeline editor produced the wrong database_file on save and visually selected both the local and the IPinfo entries in the combo box at the same time.
  • The root cause was that deserialization and serialization of database_file relied solely on the display label string (e.g. "ASN") to identify databases, making local and managed entries indistinguishable when their labels collided.
  • The fix gives local databases a distinct combo box label using their full filename including the .mmdb extension (e.g. "ASN.mmdb"). The deserializer now returns the full filename for unrecognised databases (local ones) so that selectedOptions matches the correct entry. The serializer skips the managed-database lookup when the value already ends in .mmdb, returning it as-is. A normalizeMmdbFilename helper is added to utils.ts (with a guard against double extension, e.g. ASN.mmdb.mmdb) and a getDatabaseOptionLabel helper centralises the label logic. Both are covered by new unit tests in utils.test.ts.

Test plan

  1. Upload a local database named ASN.mmdb as a cluster extension (place in .es/<version>/config/ingest-geoip/). You can use: ASN.mmdb.zip.

  2. From Stack Management → Ingest Pipelines → Manage processors, create a ASN database. Confirm both ASN.mmdb (Local) and ASN (IPinfo) appear in the list.

  3. Create (or open) an ingest pipeline with two IP Location processors:

    • First processor: database_file: "ASN.mmdb" (the local one)
    • Second processor: database_file: "standard_asn.mmdb" (the IPinfo managed one)
  4. Open each processor in the editor:

    • The first should show ASN.mmdb selected under the Local group only — no tick on the IPinfo entry.
    • The second should show ASN selected under the IPinfo group only — no tick on the Local entry.
  5. Save the pipeline without changes and inspect the request preview — values must round-trip correctly:

    • First processor: "database_file": "ASN.mmdb"
    • Second processor: "database_file": "standard_asn.mmdb"

Before/after notes

Evidence (screenshots / screen recording)

Before
Screenshot 2026-04-27 at 12 30 08
Screenshot 2026-04-27 at 12 31 08

After
Screenshot 2026-04-27 at 12 30 32
Screenshot 2026-04-27 at 12 32 25

@SoniaSanzV SoniaSanzV self-assigned this Apr 27, 2026
@SoniaSanzV SoniaSanzV requested a review from a team as a code owner April 27, 2026 10:57
@SoniaSanzV SoniaSanzV added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// Feature:Ingest Node Pipelines Ingest node pipelines management backport:all-open Backport to all branches that could still receive a release labels Apr 27, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@SoniaSanzV SoniaSanzV force-pushed the ingest_pipelines/ip_location_processor_bug branch from e78ca98 to 9b75f2f Compare April 27, 2026 11:11
Copy link
Copy Markdown
Contributor

@damian-polewski damian-polewski left a comment

Choose a reason for hiding this comment

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

I tested the fix locally and it works well and code looks good. Added one small nit about JSDoc but overall LGTM!

@SoniaSanzV SoniaSanzV enabled auto-merge (squash) April 29, 2026 13:37
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
ingestPipelines 362.8KB 362.9KB +150.0B

History

cc @SoniaSanzV

@SoniaSanzV SoniaSanzV merged commit 19f4b1c into elastic:main Apr 29, 2026
24 checks passed
@SoniaSanzV SoniaSanzV deleted the ingest_pipelines/ip_location_processor_bug branch April 29, 2026 14:46
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.2, 9.3, 9.4

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.2
9.3
9.4

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 Apr 29, 2026
…6425)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Ingest pipelines] Fix Ip location processor bug
(#265740)](#265740)

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

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

<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2026-04-29T14:46:39Z","message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Kibana
Management","Feature:Ingest Node
Pipelines","backport:all-open","v9.5.0"],"title":"[Ingest pipelines] Fix
Ip location processor
bug","number":265740,"url":"https://github.com/elastic/kibana/pull/265740","mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/265740","number":265740,"mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
kibanamachine added a commit that referenced this pull request Apr 29, 2026
…6427)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Ingest pipelines] Fix Ip location processor bug
(#265740)](#265740)

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

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

<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2026-04-29T14:46:39Z","message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Kibana
Management","Feature:Ingest Node
Pipelines","backport:all-open","v9.5.0"],"title":"[Ingest pipelines] Fix
Ip location processor
bug","number":265740,"url":"https://github.com/elastic/kibana/pull/265740","mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/265740","number":265740,"mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
kibanamachine added a commit that referenced this pull request Apr 29, 2026
…6423)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Ingest pipelines] Fix Ip location processor bug
(#265740)](#265740)

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

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

<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2026-04-29T14:46:39Z","message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Kibana
Management","Feature:Ingest Node
Pipelines","backport:all-open","v9.5.0"],"title":"[Ingest pipelines] Fix
Ip location processor
bug","number":265740,"url":"https://github.com/elastic/kibana/pull/265740","mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/265740","number":265740,"mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
kibanamachine added a commit that referenced this pull request Apr 30, 2026
…66422)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Ingest pipelines] Fix Ip location processor bug
(#265740)](#265740)

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

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

<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2026-04-29T14:46:39Z","message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Kibana
Management","Feature:Ingest Node
Pipelines","backport:all-open","v9.5.0"],"title":"[Ingest pipelines] Fix
Ip location processor
bug","number":265740,"url":"https://github.com/elastic/kibana/pull/265740","mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/265740","number":265740,"mergeCommit":{"message":"[Ingest
pipelines] Fix Ip location processor bug (#265740)\n\nCloses
https://github.com/elastic/kibana/issues/257233\n\n## Summary\n\n- When
an IP Location processor used a local database whose
filename\ncoincidentally matched a known managed database display name
(e.g.\n`ASN.mmdb` colliding with the IPinfo \"ASN\" label), the pipeline
editor\nproduced the wrong `database_file` on save and visually selected
both\nthe local and the IPinfo entries in the combo box at the same
time.\n- The root cause was that deserialization and serialization
of\n`database_file` relied solely on the display label string (e.g.
`\"ASN\"`)\nto identify databases, making local and managed
entries\nindistinguishable when their labels collided.\n- The fix gives
local databases a distinct combo box label using their\nfull filename
including the `.mmdb` extension (e.g. `\"ASN.mmdb\"`). The\ndeserializer
now returns the full filename for unrecognised databases\n(local ones)
so that `selectedOptions` matches the correct entry. The\nserializer
skips the managed-database lookup when the value already ends\nin
`.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is\nadded
to `utils.ts` (with a guard against double extension,
e.g.\n`ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises
the\nlabel logic. Both are covered by new unit tests in
`utils.test.ts`.\n\n### Test plan\n\n1. Upload a local database named
`ASN.mmdb` as a cluster extension\n(place in
`.es/<version>/config/ingest-geoip/`). You can
use:\n[ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip).\n\n2.
From Stack Management → Ingest Pipelines → Manage processors, create\na
ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo)\nappear
in the list.\n3. Create (or open) an ingest pipeline with two IP
Location processors:\n - First processor: `database_file: \"ASN.mmdb\"`
(the local one)\n- Second processor: `database_file:
\"standard_asn.mmdb\"` (the IPinfo\nmanaged one)\n4. Open each processor
in the editor:\n- The first should show `ASN.mmdb` selected under the
Local group only —\nno tick on the IPinfo entry.\n- The second should
show `ASN` selected under the IPinfo group only — no\ntick on the Local
entry.\n5. Save the pipeline without changes and inspect the request
preview —\nvalues must round-trip correctly:\n - First processor:
`\"database_file\": \"ASN.mmdb\"`\n - Second processor:
`\"database_file\": \"standard_asn.mmdb\"`\n\n### Before/after
notes\n\n### Evidence (screenshots / screen recording)\n**Before**\n<img
width=\"821\" height=\"277\" alt=\"Screenshot 2026-04-27 at 12 30
08\"\nsrc=\"https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47\"\n/>\n<img
width=\"597\" height=\"479\" alt=\"Screenshot 2026-04-27 at 12 31
08\"\nsrc=\"https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b\"\n/>\n\n**After**\n<img
width=\"822\" height=\"285\" alt=\"Screenshot 2026-04-27 at 12 30
32\"\nsrc=\"https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd\"\n/>\n<img
width=\"571\" height=\"568\" alt=\"Screenshot 2026-04-27 at 12 32
25\"\nsrc=\"https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"19f4b1c5dbf458d69fba2bf121c8c59db2cd0719"}}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release Feature:Ingest Node Pipelines Ingest node pipelines management release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v8.19.16 v9.2.9 v9.3.5 v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Location IP Processor] - Bug in ASN when using local database

5 participants