How to give tagpass for 2 or more fields

hi
data :
i have a single database. with snmp and modbus devices.
in output of mqtt i need to plublish the data for every device with different tags and fiels .
example:
device1;
tags=11,12,13
fields =a,b,c,d
i should get o/p has
dev =1
tag = 11,field =c
dev =1
tag =12 field =d

how can i achieve.
i tried tagpass and also the taginclude

thanks

I think you’d need to configure the mqtt output for each combination of tag/field and use tagpass and fieldpass for each configuration.

it is working for 1devices i.e 1 tag and fields…
if same tag that needs view other field. then configuration error is occuring.

I’d recommend sharing your Telegraf configuration and the error you’re getting

This is the config.

[[outputs.mqtt]]

URLs of mqtt brokers

servers = [“192.168.5.28:1883”]

topic for producer messages

topic_prefix = “Raw_data”

QoS policy for messages

0 = at most once

1 = at least once

2 = exactly once

qos = 0
username = “xxx”
password = “xxx”

client_id = “”

data_format = “influx”

data_format = “json”

namepass=[“SNMP_UPS”,“HoldingRegister”]

fieldpass=[“A_B”]

tagpass = “Dev50”

namepass=[“HoldingRegister”]

fieldpass=[“PF”]

 [outputs.mqtt.tagdrop]
  tag1 =[ "tag1.Dev51","tag1.Dev52"]
   tagpass = "tag1.Dev50" 
    fieldpass=["PF"]

there are 34 tags …and some fiellds .
for each tags i need to configure different some fields…which different from each tag.
if tag1 =dev50.dev51,dev52.
i need configure different fields for each tag(i.e dev50).

i need like this format as output

{
“fields” : {
“A_B” : 0,

},
“name” : “HoldingRegister”,
“tags” : {
“host” : “xxx”,
“tag1” : “Dev52”
},
“timestamp” : 1568858538
}

{
  "fields" : {
    "A_B" : 0,
	"A_R"  : 0,
    
  },
  "name" : "HoldingRegister",
  "tags" : {
    "host" : "xxx",
    "tag1" : "Dev51"
  },
  "timestamp" : 1568858538
  ````````````````````````````````````
  {
  "fields" : {
    "A_B" : 0,
	"A_R"  : 0,
    "PF":0
  },
  "name" : "HoldingRegister",
  "tags" : {
    "host" : "xxx",
    "tag1" : "Dev51"
  },
  "timestamp" : 1568858538