Skip to content

Conversation

jbaiera
Copy link
Member

@jbaiera jbaiera commented Sep 25, 2025

The JSON processor has an option that merges the contents of a parsed json string to the root of the document. When operating in this way, the logic was simply gathering the json string directly from the root of the document. This means that nested fields would not be readable. This is likely because in painless, the exact same functionality is exposed as a built in processor function. In painless, field traversal can be done outside of the processor logic. When calling the method, it will add the contents to whichever map is provided. This is working as expected and should not change. When running in the ingest node, the processor handles all field lookups from the document. This is where the fix was applied.

Fixes: #135170

Since this is a long standing bug, I will try and get a backport to the 8.19 branch as well.

@jbaiera jbaiera added >bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP v9.2.0 v8.19.5 labels Sep 25, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Sep 25, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine
Copy link
Collaborator

Hi @jbaiera, I've created a changelog YAML for you.

Copy link
Contributor

@seanzatzdev seanzatzdev left a comment

Choose a reason for hiding this comment

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

Looks good to me, I agree with @joegallo 's comment

Copy link
Contributor

@joegallo joegallo left a comment

Choose a reason for hiding this comment

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

LGTM besides my little comment. I'm shocked that this never came up before now! Good fix, @jbaiera.

@jbaiera jbaiera added the auto-backport Automatically create backport pull requests when merged label Sep 25, 2025
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19
9.1
8.18
9.0

jbaiera added a commit to jbaiera/elasticsearch that referenced this pull request Sep 25, 2025
…document root (elastic#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>
jbaiera added a commit to jbaiera/elasticsearch that referenced this pull request Sep 25, 2025
…document root (elastic#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>
jbaiera added a commit to jbaiera/elasticsearch that referenced this pull request Sep 25, 2025
…document root (elastic#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>
jbaiera added a commit to jbaiera/elasticsearch that referenced this pull request Sep 25, 2025
…document root (elastic#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Sep 26, 2025
…ts to document root (#135479) (#135498)

* Correctly apply field path to JSON processor when adding contents to document root (#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>

* Remove missing test util

---------

Co-authored-by: Joe Gallo <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Sep 26, 2025
…nts to document root (#135479) (#135495)

* Correctly apply field path to JSON processor when adding contents to document root (#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>

* Remove missing test util

---------

Co-authored-by: Joe Gallo <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Sep 26, 2025
…nts to document root (#135479) (#135497)

* Correctly apply field path to JSON processor when adding contents to document root (#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>

* Remove missing test util

---------

Co-authored-by: Joe Gallo <[email protected]>
elasticsearchmachine pushed a commit that referenced this pull request Sep 26, 2025
…ts to document root (#135479) (#135496)

* Correctly apply field path to JSON processor when adding contents to document root (#135479)

Processor now correctly uses ingest document methods to obtain field data.

---------

Co-authored-by: Joe Gallo <[email protected]>

* Remove missing test util

---------

Co-authored-by: Joe Gallo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP Team:Data Management Meta label for data/management team v8.18.8 v8.19.5 v9.0.8 v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ingest pipelines: JSON processor not honoring field_access_pattern with add_to_root
5 participants