influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.55k stars 5.56k forks source link

OPCUA - Read the data of an array #11898

Open Giu-seppe opened 2 years ago

Giu-seppe commented 2 years ago

Use Case

I am using the plugin OPC UA but cannot access inside an array

For objects I simply solved by pointing to the variable within the structure Structure example:

V10 = {
   RPMx100 = 100;
   Temp = 18;
   PowerOn = True;
}

Configuration used

nodes = [
    {name="V10.RPMx100", namespace="6", identifier_type="s", identifier="::Program:V10.RPMx100"},
    {name="V10.temp", namespace="6", identifier_type="s", identifier="::Program:V10.temp"},
    {name="V10.powerOn", namespace="6", identifier_type="s", identifier="::Program:V10.powerOn"},
    {name="V10.torque", namespace="6", identifier_type="s", identifier="::Program:V10.torque"},
    {name="V10.torquePercentage", namespace="6", identifier_type="s", identifier="::Program:V10.torquePercentage"},
  ]

Expected behavior

It would be convenient to access an array address via dot annotation or by entering the address in square brackets

Examples

    {name="byteArray", namespace="6", identifier_type="s", identifier="::Program:byteArray.2"},

or

    {name="byteArray", namespace="6", identifier_type="s", identifier="::Program:byteArray[1]"},

Actual behavior

It is currently not possible to read data within an array. If you try to read the metrics of an entire array, the plugin does not return any errors but not even any data

Additional info

I have previously opened a post on the influx data forum, I am attaching the link in case it may be useful

reimda commented 2 years ago

Hi @Giu-seppe, thanks for the feature request. Are you able to write a PR to make the code changes to Telegraf? Could you provide test data that we can use to build a unit test for array data?

Giu-seppe commented 2 years ago

No, unfortunately I am not able to write this code :(

image This is an example of a byte array I try to read.

reimda commented 2 years ago

@Giu-seppe I've labeled this "help wanted" to invite any interested developers to contribute a PR

Giu-seppe commented 2 years ago

Thank you @reimda

Doolhofx commented 8 months ago

@Giu-seppe Did you already find another solution to log arrays? Since I see this topic is still open. I am also in the need to log data that's inside an array.