Kapacitor: Add tag if condition is met

I want to add a tag to the input if the clusterName is X
So I did:
stream
// Select just the cpu measurement from our example database.
|from()
.measurement(‘cloudwatch_aws_ecs’)
|eval(lambda: “cluster_name” == ‘awseb-access-12345’).as(‘clusterType’)
|influxDBOut()
.database(‘telegraf’)
.retentionPolicy(‘autogen’)
.measurement(‘cloudwatch_aws_ecs’)

But it doesnt seem to work. How can I do this?

What is the tag you want to add?

See EvalNode | InfluxData Documentation Archive and Lambda Expressions | InfluxData Documentation Archive

Those should help you get it working.

2 Likes