Filter to drop based on condition not working #21921
-
Hello, I have this transformation applied in my values.yaml:
What I want to do is drop all logs that have the "RemoveStaleState" string in the message.
I am running vector as a helm chart deployment, inside an AWS EKS cluster. I am also running datadog agent inside that cluster. I used vector tap to get the example event above. Any ideas why my transform is not working? Expected would be to drop the event but it is still kept and forwarded. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
My first guess would be that your downstream components aren't using sources:
source0:
type: stdin
decoding:
codec: json
transforms:
transform0:
type: filter
inputs:
- source0
condition: 'contains(string!(.message), "RemoveStaleState") == false'
sinks:
sink0:
type: console
inputs:
- transform0
encoding:
codec: json And the example input event you provided was dropped as expected. |
Beta Was this translation helpful? Give feedback.
I think the issue here is that you have both transforms as inputs to the sink:
Because both inputs here have
datadog_agent.logs
as their input, that means you will "fan out" and then "fan in" such that will end up with duplicate events. I'm guessing that the events you expect to see dropped by the filter are actually being dropped, but those same events are also going throughdrop_status
, where they won't be dropped' and then forwarded to thedatadog_logs
sink.Visualizing the configuration with
vector graph
might make this clearer:I think you may mean to chain the
drop_status
anddrop_kubelet_removestalestate
…