Skip to content

FIltering and Tests for Filters #22905

Answered by pront
satellite-no asked this question in Q&A
Discussion options

You must be logged in to vote
transforms:
  my_filter:
    type: filter
    inputs:
      - my-s3-bucket
    condition:
      type: vrl
      source: |
        !ends_with(string!(.object), "snappy", case_sensitive: false) ||
        !ends_with(string!(.object), "parquet", case_sensitive: false)


tests:
  - name: Drop unsupported S3 objects
    inputs:
      - type: vrl
        insert_at: my_filter
        source: |-
          . = {
            "bucket":"my-s3-bucket",
            "message":"gibberesh",
            "object":"raw/win/log_date=2025-04-14/3d52fdb4-d5d5-4f3f-b944-c7fa0820e51d.snappy",
            "region":"us-east-1",
            "source_type":"aws_s3",
            "timestamp":"2025-04-14T10:13:29Z"
     …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@satellite-no
Comment options

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: filter Anything `filter` transform related
2 participants