Nats output receiving data

im trying to work this scenario
telegraf(nats) in → kapacitor task to measurement → telegraf(nats) out to clients
Everything is working fine expect the telegraf(nats) output
when i set the subject to subject = “natsout”
im receiving all the telegraf stream like diskio kapacitor and other measurement…
if im setting the subject name to subject = “telegraf.natsout” im geting nothing.

UPDATE
i review the telegraf code and its look like its sent all the metrics from telegref and not from the measurement only.

the only thing i can think about it without breaking the interface is to filter by name

func (n *NATS) Write(metrics telegraf.Metric) error {
if len(metrics) == 0 {
return nil
}

for _, metric := range metrics {
//if metric.Name = n.measurement send it…
buf, err := n.serializer.Serialize(metric)
if err != nil {
return err
}

  err = n.conn.Publish(n.Subject, buf)
  if err != nil {
  	return fmt.Errorf("FAILED to send NATS message: %s", err)
  }

}
return nil
}

Any suggestions ?

@miki_haiat I don’t quite follow, it would be useful if you included your config for the plugin and what you are desiring/expecting as output vs what output you actually get.

If you just want to filter output make sure you check the measurement filtering options.

1 Like

@daniel this is exactly what looked for.
even though nats output from kapacitor will be work better because we don’t have to save the data in influx
we talked about this option here tickscript-help