Skip to content
Discussion options

You must be logged in to vote

I figured it out

sources:
  swarm:
    type: docker_logs
    auto_partial_merge: true
    include_labels: ["com.docker.stack.namespace=dev"]

transforms:
  remap_swarm:
    type: remap
    inputs:
      - "swarm"
    source: |
      .stack_namespace = .label."com.docker.stack.namespace"
      del(.label)
      del(.stream)

sinks:
  file:
    inputs:
      - "remap_swarm"
    type: file
    path: "/out/{{ .stack_namespace }}"
    encoding:
      codec: "json"

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant