# Telegraf exec input make a changing data

**URL:** https://community.influxdata.com/t/telegraf-exec-input-make-a-changing-data/23583
**Category:** Telegraf
**Tags:** influxdb, prometheus, exec
**Created:** [January 29, 2022, 1:21am UTC](https://community.influxdata.com/t/telegraf-exec-input-make-a-changing-data/23583 "2022-01-29T01:21:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Peter753l](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/peter753l/32/9359_2.png) [@Peter753l](https://community.influxdata.com/u/Peter753l)
#### Post date: [January 29, 2022, 1:21am UTC](https://community.influxdata.com/t/telegraf-exec-input-make-a-changing-data/23583/1 "2022-01-29T01:21:27Z")

</div>

hello everyone,

I found a problem while using exec.  
my shell:

```auto
alert_test_3.sh: |
#/bin/bash
echo "IfTable,agent_host=test,hostname=test,ifDescr=test,ifType=6 ifOperStatus=1,ifAdminStatus=1"
sleep 30s
echo "IfTable,agent_host=test,hostname=test,ifDescr=test,ifType=6 ifOperStatus=2,ifAdminStatus=1"

```

```auto
telegraf.conf: |
[agent]
interval = "60s"
round_interval = false
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "2s"
debug = true
omit_hostname = true

```

```auto
[[inputs.exec]]
  commands = [
    "bash /etc/telegraf/alert_test_3.sh"
    ]
  timeout = "60s"
  data_format = "influx"

```

I do want to simulate a situation.  
In prometheus I have an alert rule that requires an hour minimum of 1 and currently is 2.

```auto
min_over_time(IfTable_ifOperStatus{ifDescr!~"(ifType="6"}[1h]) == 1 and IfTable_ifOperStatus{ifType="6"} == 2 and IfTable_ifAdminStatus{ifType="6"} == 1

```

My prometheus acquisition cycle is 30s. For work reasons, I need to artificially create this kind of data to keep this alert firing.But I can only get the data after 30s, the data before 30s will not be collected.I don’t know why.I hope you can give me some advice 😬

---

<div class="post-metadata">

### Author: ![Giovanni\_Luisotto](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/giovanni_luisotto/32/4017_2.png) [@Giovanni\_Luisotto](https://community.influxdata.com/u/Giovanni_Luisotto)
#### Post date: [January 31, 2022, 8:42am UTC](https://community.influxdata.com/t/telegraf-exec-input-make-a-changing-data/23583/2 "2022-01-31T08:42:17Z")

</div>

the points you are writing are identical (same key), that’s why.  
the second point is updating the first one, the timestamp is the same because the timestamp is added by InfluxDB when the data is written (unless you specify it).

if you want more points using this method just write one point with _echo_, and lower the _interval_ parameter to 20/30s. this way you will get more than one point in a minute (since the timestamp will differ)
