Skip to content

Support function composition in expressions #6322

Closed

Description

@dlvenable

Is your feature request related to a problem? Please describe.

My suggestion to solve #6278 is to provide a toJsonString() function that a pipeline author could provide into length() to get the length of an event when serialized as a JSON string.

This is not currently possible because Data Prepper expressions do not allow composing functions.

This can be useful for other functions. Some possible examples:

  • Get the length of a joined string: length(join(/names))
  • Make a decision if a metadata field starts with a certain substring: startsWith(getMetadata("mymetadata"), "someprefix")

Describe the solution you'd like

Update Data Prepper expressions to support function composition:

f(g(x))

Describe alternatives you've considered (Optional)

N/A

Additional context

Proposal to use this feature for a current ask:

#6278 (comment)

Activity

  1. self-assigned this
    on Dec 3, 2025
  2. added this to the v2.14 milestone on Dec 3, 2025
  3. moved this from Unplanned to In progress in Data Prepper Tracking Boardon Dec 3, 2025
  4. modified the milestones: v2.14, v2.15 on Feb 17, 2026
  5. added 4 commits that reference this issue on Mar 10, 2026
    b702cc0
    bc31e46
    6c758e5
    e2298ae
  6. moved this from In progress to In review in Data Prepper Tracking Boardon Mar 10, 2026
  7. added a commit that references this issue on Mar 12, 2026
    3734d6a
  8. added a commit that references this issue on Jul 1, 2026
    6cd67b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions