OPC UA on Telegraf and column database

Hi all,
I’m a beginner in Telegraf and InfluxDB, and I configured input in Telegraf with OPC UA and with the follow configuration :

: nodes = [
  {name="Tag1", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag1"}, 
  {name="Tag2", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag2"},
  {name="Tag3", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag3"}
]

I get in database for each Tag(n) the correspondent value like the follow one:
"host","id","Quality","timestamp","Tag1","Tag2","Tag3"

timestamp … Tag1_val,null, null
timestamp … null,Tag2_val, null
timestamp … null, null, Tag3_val

and I would like the follow:
"host","id","Quality","timestamp","Tag"

timestamp … Tag1_val
timestamp … Tag2_val
timestamp … Tag3_val

who can suggest me which could be the configuration?
Best Regards
Alberto

Hello @alberto_p,

If you want each tag to be in its own measurement:

[[inputs.opcua]]
  endpoint = "opc.tcp://localhost:4840"
  security_policy = "None"
  security_mode = "None"
  authentication_method = "Anonymous"
  name_override = "opcua"
  metric_name = "opcua_metrics"
  
  nodes = [
    {name="Tag1", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag1"}, 
    {name="Tag2", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag2"},
    {name="Tag3", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag3"}
  ]

  fieldpass = ["Tag1", "Tag2", "Tag3"]

If you want all tags to be in a single measurement but on separate rows:

[[inputs.opcua]]
  endpoint = "opc.tcp://localhost:4840"
  security_policy = "None"
  security_mode = "None"
  authentication_method = "Anonymous"
  name_override = "opcua"
  metric_name = "opcua_metrics"
  
  nodes = [
    {name="Tag1", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag1"}, 
    {name="Tag2", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag2"},
    {name="Tag3", namespace="2", identifier_type="s", identifier="Channel1.Device1.Tag3"}
  ]

  fieldpass = ["Tag1", "Tag2", "Tag3"]

Does that help?

Hi Anaisdg,
thanks’ for quick response!
I tried to apply both solutions but the only effect that I can see is visible below.

without fieldinclude is present the Quality key,value:

opcua,host=QUESTDB,id=ns=2;s=B11.Device1.M.Alarm.0x0000 Quality=“The operation succeeded. StatusGood (0x0)”,Tag5=1i 1717687067000000000
opcua,host=QUESTDB,id=ns=2;s=B11.Device1.M.Alarm.0x0001 Quality=“The operation succeeded. StatusGood (0x0)”,Tag6=1i 1717687067000000000

with fieldinclude:

opcua,host=QUESTDB,id=ns=2;s=B11.Device1.M.Alarm.0x0000 Tag5=2i 1717687667000000000
opcua,host=QUESTDB,id=ns=2;s=B11.Device1.M.Alarm.0x0001 Tag6=2i 1717687667000000000

and in database still present the form
timestamp … Tag5_val,null
timestamp … null,Tag6_val

Additional: filedpass seems deprecated and suggest to use fieldinclude, and name_override and metric_name has no effect on the output.

Best Regards
Alberto