FromNode Property Method measurement() without parameter


I have several measurements with certain characteristics. Some measurements have specific fields due to some aspect of them belonging in a sub-group of devices. I’d like to process data on a stream over all measurements which have a specific set of fields and tags.

I created a stream like this:

var myStream = stream
        .groupByMeasurement() # I tried to add this, yields to another error
        .where(lambda: isPresent('someTag') == false AND (isPresent('someField') OR isPresent('otherField')))

In the stream there is an alertNode with idVar: name + ‘:’ + db + ‘:{{.Group}}’

Doing this without the groupByMeasruement() property I get the behavior, that the stream is executing on a measurement alone as well as on the a set of tags included in the write operation, which leads to two ‘executions’ which should only be one.

When adding the groupByMeasurement it yields the error

too many arguments to set property Measurement on *pipeline.FromNode

I’m expecting if I use from().measurement and from().groupByMeasurement, that the kapacitor stream-task now attaches to every measurement and groups the data by these measurements.

I’m a bit lost now on how to proceed. The documentation does not say anything about this error and apart from that there is not much information about the from().measurement() and from().groupByMeasurement() properties. I’m just left to trial and error right now. Maybe someone else has a brilliant idea? :smiley:

EDIT 1: What is also completely driving me nuts is this: If I try to negate the output of isPresent() in any way possible with if()-clause or == FALSE it just stops working on anything. It only applies on a data stream which actually has the specified field/tag. Since I have another measurement logging the event in the same database, with the exact same tags I’d have to check if a field is not present to describe the stream I want to attach to.