-
Hey all, still testing Vector a bit, and I'm not even sure how to search on this one... As far as I can tell my filter transform is doing the opposite of what I think it should. My config: sources:
base_host_metrics:
type: host_metrics
transforms:
load5valuethreshold:
type: filter
inputs:
- base_host_metrics
condition: exists(.name) && .name == "load5" && to_float!(.gauge.value) <= 0.01
load5valuethreshold_to_log:
type: metric_to_log
inputs:
- load5valuethreshold
sinks:
load5valuethreshold__file:
type: file
inputs:
- load5valuethreshold_to_log
path: /home/vagrant/metrics/load5valuethreshold-%Y-%m-%d.log
encoding:
codec: json Results in the output file looking like: {"gauge":{"value":1.0},"host":"sw-dev-node-01","kind":"absolute","name":"load5","namespace":"host","tags":{"collector":"load"},"timestamp":"2024-03-20T18:45:36.567502707Z"}
{"gauge":{"value":1.0},"host":"sw-dev-node-01","kind":"absolute","name":"load5","namespace":"host","tags":{"collector":"load"},"timestamp":"2024-03-20T18:45:51.567415239Z"}
{"gauge":{"value":1.0},"host":"sw-dev-node-01","kind":"absolute","name":"load5","namespace":"host","tags":{"collector":"load"},"timestamp":"2024-03-20T18:46:06.567562208Z"} I should be getting values less than 0.01, right? Why am I getting the opposite? Is Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
jszwedko
Mar 22, 2024
Replies: 1 comment 3 replies
-
I think you are running into #5521; basically |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe
.gauge.value
will always returnnull
whichto_float
will convert to0
which is why it is always matching your condition.