Different time interval for each telegraf input

Hi,

We are trying to send data to Influx2.0 using opcua group plugin in the telegraf file, but is it possible to send data of each opcua group in different time interval? How can I do this?

1 Like

Hi, if you split each group up into a separate inputs config section, you can set a different interval for each section.

Ok, but I think I can set interval only under [agent]. Can I set different intervals under [[inputs.opcua.groupA]] & [[inputs.opcua.groupB]] ?

Hi @Aritra666B,
Yes, you can here is an example:

# Configuration for telegraf agent
[agent]
  interval = "5s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000

  collection_jitter = "5s"
  flush_interval = "10s"
  flush_jitter = "5s"

  precision = ""
  hostname = ""
  omit_hostname = false


###############################################################################
#                            INPUT PLUGINS                                    #
###############################################################################
[[inputs.opcua]]
  interval = "10s"
  name = "groupA"
  endpoint = "opc.tcp://localhost:49330"
  security_policy = "auto"
   security_mode = "auto"
   certificate = ""
   private_key = ""
  
   auth_method = "UserName"
   username = "Administrator"
   password = "serverserverserver"

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

[[inputs.opcua]]
  interval = "60s"
  name = "groupB"
  endpoint = "opc.tcp://localhost:49330"
  security_policy = "auto"
   security_mode = "auto"
   certificate = ""
   private_key = ""
  
   auth_method = "UserName"
   username = "Administrator"
   password = "serverserverserver"

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


The interval specified within the input plugin overrules the global interval.

1 Like

Thanks. It worked perfectly.

1 Like

Awesome! Glad its up and running :slight_smile: