# Set time between plugins

**URL:** <https://community.influxdata.com/t/set-time-between-plugins/33367>\
**Category:** Telegraf\
**Created:** [February 28, 2024, 7:18am UTC](https://community.influxdata.com/t/set-time-between-plugins/33367 "2024-02-28T07:18:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![svenvg93](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@svenvg93](https://community.influxdata.com/u/svenvg93)\
**Post date:** [February 28, 2024, 7:18am UTC](https://community.influxdata.com/t/set-time-between-plugins/33367/1 "2024-02-28T07:18:15Z")

</div>

Im trying to setup a performance measurement probe. One of part of it is telegraf running a the ping and exec input. exec input runs a speedtest. The problem is that the ping and exec seem to be running at the same time, which means that the ping result will be higher due to the speedtest. Im looking for a way to make them run after eachother. Or atleast not at the same time. So the results of the ping input is not influenced by the other inputs.

```auto
[[inputs.exec]]
commands = ["/usr/bin/speedtest -f json-pretty -s 52365"]
name_override = "Speedtest"
timeout = "1m"
interval = "30m"
data_format = "json"
json_string_fields = [ "interface_externalIp",
                       "server_name",
                       "server_location",
                       "server_host",
                       "server_ip",
                       "result_url" ]

# Ping given url(s) and return statistics
[[inputs.ping]]
  urls = ["nl-ams-as1200.anchors.atlas.ripe.net","cdn.17app.co.akamaized.net"]
  # method = "exec".
  count = 10
  interval = 30
  # ping_interval = 10.0
  # timeout = 1.0
  # deadline = 10.
  # interface = ""
  # percentiles = [50, 95, 99]
  # binary = "ping"
  # arguments = ["-c", "3"]
  # ipv6 = false.
  # size = 56

# Query given DNS server and gives statistics
[[inputs.dns_query]]
  servers = ["192.168.1.1"]
  # network = "udp"
   domains = ["google.nl","nu.nl"]
  # record_type = "A"
  # port = 53
  # timeout = "2s"
  interval = "3m"

# HTTP/HTTPS request given an address a method and a timeout
[[inputs.http_response]]
   urls = ["https://google.nl","https://nu.nl.nl"]
  # response_timeout = "5s"
   method = "GET"
  follow_redirects = true
  interval = "3m"

```

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [February 28, 2024, 7:46pm UTC](https://community.influxdata.com/t/set-time-between-plugins/33367/2 "2024-02-28T19:46:24Z")

</div>

Hello @svenvg93,  
Welcome!  
Telegraf executes input plugins based on the order they appear in the configuration file. If you have multiple input plugins and wish to prioritize some over others, you can order them accordingly in the config file.

There isnt a way to introduce delays or depends on. However you could do that with multiple agents in docker for example.

---

<div class="post-metadata">

**Author:** ![R290](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/r290/32/9425_2.png) [@R290](https://community.influxdata.com/u/R290)\
**Post date:** [February 29, 2024, 3:48pm UTC](https://community.influxdata.com/t/set-time-between-plugins/33367/3 "2024-02-29T15:48:33Z")

</div>

Would setting a collection offset for one of the plugins work for you? See: [telegraf/docs/CONFIGURATION.md at master · influxdata/telegraf · GitHub](https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#input-plugins). You could delay the ping by 1 minute for example.

---

<div class="post-metadata">

**Author:** ![svenvg93](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@svenvg93](https://community.influxdata.com/u/svenvg93)\
**Post date:** [February 29, 2024, 3:56pm UTC](https://community.influxdata.com/t/set-time-between-plugins/33367/4 "2024-02-29T15:56:47Z")

</div>

Will give it a shot and report back

---

<div class="post-metadata">

**Author:** ![svenvg93](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@svenvg93](https://community.influxdata.com/u/svenvg93)\
**Post date:** [March 5, 2024, 6:25am UTC](https://community.influxdata.com/t/set-time-between-plugins/33367/5 "2024-03-05T06:25:12Z")

</div>

Thanks for the suggestion 🙂  
I give the speedtest the a collection\_offset = “2m” to make it run over 2 minutes after the hour. This way it runs during the interval of all the all tests. Thanks for all the help!
