Telegraf. MQTT consumer, parse only nessesary fields


I am using telegraf to listen to my LoRa MQTT topics and write them into influxdb. Everything works fine, except I need to parse/store only specific fields and discard all the rest. I have done it via python but cant’ really figure out how to do same with telegraph. below is the sample, I only need SRN and rssi fields (there is bunch of other stuff). I think there should be some kind of template or schema that I can feed into telegraf?

many thanks in advance,

You can use either fieldpass or fielddrop to either remove or only allow certain fields

Many thanks. I knew I saw this somewhere but lost it one the way. I will try and revert back.

It worked. Here’s my config now. it only injects these 2 fields in db, rest are discarded. Thanks again

## rest of config for mqtt ##
fieldpass = ["rxInfo_rssi","rxInfo_loRaSNR"]

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.