Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for parse_json on complex json structures with arrays and nested arrays #4961

Open
graytaylor0 opened this issue Sep 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@graytaylor0
Copy link
Member

Is your feature request related to a problem? Please describe.
As a user with data in the format of

{
   "array_one": [
        {
           "array_two": [
                {
                     "field_one": {
                          "json_string": "{ \"key\": \"value\" }"
                     }
                },
                {
                     "field_one": {
                          "json_string": { \"key_two\": \"value-two\" }
                     }
                }
           ]
       },
       {
           "array_two": [
                {
                     "field_one": {
                          "json_string": "{ \"key\": \"value\" }"
                     }
                },
                {
                     "field_one": {
                          "json_string": { \"key_two\": \"value-two\" }
                     }
                }
           ]
       }
   ]
}

I would like to parse the nested json for the json_string in all objects of the nested arrays. This is not currently possible with the parse_json processor as it only supports json_pointer

Describe the solution you'd like
A new configuration to support this use case. One idea would be to utilize JSON path as the above example can be represented as this json path

- parse_json:
        source_path: "array_one[*].array_two[*].field_one.json_string"

And this would convert all of the nested json fields to valid json format.

Describe alternatives you've considered (Optional)
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@dlvenable dlvenable added enhancement New feature or request and removed untriaged labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants