[Ingest pipelines] Fix Ip location processor bug#265740
Merged
SoniaSanzV merged 5 commits intoelastic:mainfrom Apr 29, 2026
Merged
[Ingest pipelines] Fix Ip location processor bug#265740SoniaSanzV merged 5 commits intoelastic:mainfrom
SoniaSanzV merged 5 commits intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/kibana-management (Team:Kibana Management) |
e78ca98 to
9b75f2f
Compare
damian-polewski
approved these changes
Apr 29, 2026
Contributor
damian-polewski
left a comment
There was a problem hiding this comment.
I tested the fix locally and it works well and code looks good. Added one small nit about JSDoc but overall LGTM!
Updated the JSDoc comment to remove redundancy.
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
cc @SoniaSanzV |
Contributor
|
Starting backport for target branches: 8.19, 9.2, 9.3, 9.4 https://github.com/elastic/kibana/actions/runs/25115830761 |
This was referenced Apr 29, 2026
Contributor
💚 All backports created successfully
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #257233
Summary
ASN.mmdbcolliding with the IPinfo "ASN" label), the pipeline editor produced the wrongdatabase_fileon save and visually selected both the local and the IPinfo entries in the combo box at the same time.database_filerelied solely on the display label string (e.g."ASN") to identify databases, making local and managed entries indistinguishable when their labels collided..mmdbextension (e.g."ASN.mmdb"). The deserializer now returns the full filename for unrecognised databases (local ones) so thatselectedOptionsmatches the correct entry. The serializer skips the managed-database lookup when the value already ends in.mmdb, returning it as-is. AnormalizeMmdbFilenamehelper is added toutils.ts(with a guard against double extension, e.g.ASN.mmdb.mmdb) and agetDatabaseOptionLabelhelper centralises the label logic. Both are covered by new unit tests inutils.test.ts.Test plan
Upload a local database named
ASN.mmdbas a cluster extension (place in.es/<version>/config/ingest-geoip/). You can use: ASN.mmdb.zip.From Stack Management → Ingest Pipelines → Manage processors, create a ASN database. Confirm both
ASN.mmdb(Local) andASN(IPinfo) appear in the list.Create (or open) an ingest pipeline with two IP Location processors:
database_file: "ASN.mmdb"(the local one)database_file: "standard_asn.mmdb"(the IPinfo managed one)Open each processor in the editor:
ASN.mmdbselected under the Local group only — no tick on the IPinfo entry.ASNselected under the IPinfo group only — no tick on the Local entry.Save the pipeline without changes and inspect the request preview — values must round-trip correctly:
"database_file": "ASN.mmdb""database_file": "standard_asn.mmdb"Before/after notes
Evidence (screenshots / screen recording)
Before


After

