Telegraf separate data to different influxes databases

I want all of the metrics from inputs.snmp / input.snmp.field to be transferred to influxdb’s “syno” database and all others to the default database. Unfortunately it doesn’t work with the filter namepass=["mem*"].
Does anyone have an idea how to best implement this?

[[outputs.influxdb]]
urls = [“http://192.168.XXX.XX:8086”]
database = “default”
skip_database_creation = true
retention_policy_tag = “”
write_consistency = “any”
timeout = “30s”
username = “telegraf”
password = “secret”
[[outputs.influxdb]]
urls = [“http://192.168.XXX.XX:8086”]
database = “syno”
skip_database_creation = true
retention_policy_tag = “”
write_consistency = “any”
timeout = “30s”
username = “telegraf”
password = “secret”
namepass = [“mem*”]
[[inputs.snmp]]
agents = [“tcp://192.168.XXX.XX:161”]
timeout = “30s”
version = 3
community = “public”
retries = 3
max_repetitions = 30
name = “snmp_SYNO”
sec_name = “superuser”
auth_protocol = “SHA”
auth_password = “secret”
sec_level = “authPriv”
priv_protocol = “AES”
priv_password = “secret”
[[inputs.snmp.field]]
name = “memTotalSwap”
oid = “UCD-SNMP-MIB::memTotalSwap.0”
[[inputs.snmp.field]]
name = “memAvailSwap”
oid = “UCD-SNMP-MIB::memAvailSwap.0”
[[inputs.snmp.field]]
name = “memTotalReal”
oid = “UCD-SNMP-MIB::memTotalReal.0”
[[inputs.snmp.field]]
name = “memAvailReal”
oid = “UCD-SNMP-MIB::memAvailReal.0”
[[inputs.snmp.field]]
name = “memTotalFree”
oid = “UCD-SNMP-MIB::memTotalFree.0”

namepass applies a filter based on the measurement name, if you want to filter based on filed names you should use fieldpass and fielddrop. (It should work but I don’t feel like recommending it as is not as precise/safe as the other option)

I suggest you go for namepass/namedrop or tagpass/tagdrop (see docs), meaning you will have to either have different measurement names, or adding a static tag to your data in order to be able to filter them.

something like

[[inputs.snmp]]
  {...}
  [inputs.snmp.tags]
    Type= "mem"

[[inputs.snmp]]
  {...}
  [inputs.snmp.tags]
    Type= "def"

[[outputs.influxdb]]
  database = “default”
  {...}
  [outputs.influxdb.tagpass]
    Type = ["def"]

[[outputs.influxdb]]
  database = “syno”
  {...}
  [outputs.influxdb.tagpass]
    Type = ["mem"]

you may want to add also tagexclude = ["Type "] to avoid storing the “filtering tag” into the database