How to select only few tags for Kapacitor and UDF?

I have an UDF (wants/provides = STRAEM) which is executing as I wanted. But at output I get unwanted tags.
I have 2 choices. 1, to select wanted tags while reading and 2, drop unwanted tags in UDF.

As far as I know, I need to use |from().measurement()…
I can not find any other node to select tags for my input stream.

For UDF, I can add new tags using response.point.tags[‘key’] = value
but I dont how to select few tags out of available tags.

Could you please let me know how to solve this?


According to Kapacitor docs for groupby node:

The groupBy node will group the incoming data. Each group is then processed independently for the rest of the pipeline. Only tags that are dimensions in the grouping will be preserved. All other tags are dropped.

But, even if I use only one tag in .groupBy node, other tags are also preserved.

I have managed to solve this by using delete node.
But I am still interested in why groupBy does not drop other tags.