Open lucperkins opened 3 years ago
Per https://github.com/vectordotdev/vector/pull/9091, along with a name change, it'd be ideal if we could represent the expanded object form of condition
in docs, and note the shorthand variant as an alternative.
This would allow us to use datadog_search
as the condition type.
I'm not sure how to do that in cue without breakage.
I'm pretty certain this is already possible?
That is, the condition
field can be a VRL source, or an object with a type
and whatever other fields are required by that type.
So these are identical:
[transforms.my_transform.ends_when]
type = "vrl"
source = "exists(.some_field)
transforms.my_transform.ends_when = "exists(.some_field)"
I'll close this, as I don't believe there's any more work left to do here.
It looks like we still use source
for conditions in reduce
at least.
https://vector.dev/docs/reference/configuration/transforms/reduce/#starts_when.source
Just noting that the request was to rename the source
field to condition
. Maybe we don't want to do that though? In which case we could close this as wont-fix.
Aha, interesting. Also, should we more prominently promote starts_when = '.foo == true'
syntax, which forgoes any of the type
and source
/condition
requirements.
I've notified that in our unit testing suite, you specify an
ends_when
condition using asource
field, e.g.:I think it'd be more intuitive to use
condition
and thereby bring unit testing in line with theroute
andfilter
transforms. This is the only place I've seen this but there may be others, and I'd recommend updating all of them.