Skip to content

splitting messages based on content #1364

Answered by Jeffail
madalina2311 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @madalina2311 yeah that should be possible with interpolation functions on the path field (https://www.benthos.dev/docs/components/outputs/gcp_cloud_storage#path):

You'd need to group the messages by the target folder before archiving them into the final file format, it'd look something like this:

output:
  gcp_cloud_storage:
    bucket: foo
    path: ${! meta("dir") }/${! uuid_v4() }.jsonl
    max_in_flight: 64
    batching:
      count: 1000
      processors:
        - group_by_value:
            value: ${! this.foo }
        - bloblang: 'meta dir = this.foo'
        - archive:
            format: lines

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@madalina2311
Comment options

Answer selected by madalina2311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants