Skip to content
Discussion options

You must be logged in to vote

For the service = "bar" example, use sample.exclude: events matching exclude pass through unchanged. Conditions can also contain multiline VRL, as long as the final expression returns a boolean.

This pipeline drops messages containing /health, keeps one in four remaining bar logs, and keeps all other logs:

sources:
  logs:
    type: stdin
    decoding:
      codec: json

transforms:
  drop_health_checks:
    type: filter
    inputs: [logs]
    condition: |
      message = string(.message) ?? ""
      !contains(message, "/health")

  sample_bar:
    type: sample
    inputs: [drop_health_checks]
    rate: 4
    exclude: |
      service = string(.service) ?? ""
      service != "bar"

sinks:
  

Replies: 2 comments 1 reply

Comment options

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

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
transform:sample Anything `sample` transform related transform:filter Anything `filter` transform related domain:vrl Anything related to the Vector Remap Language domain:filtering Anything related to filtering within Vector
2 participants