# Telegraf writes to two InfluxDB databases same data

**URL:** <https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920>\
**Category:** Telegraf\
**Tags:** telegraf\
**Created:** [October 23, 2023, 7:54pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920 "2023-10-23T19:54:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![skinfrakki](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@skinfrakki](https://community.influxdata.com/u/skinfrakki)\
**Post date:** [October 23, 2023, 7:54pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/1 "2023-10-23T19:54:25Z")

</div>

I have the following config in my telegraf for InfluxDB:

[[outputs.influxdb]]  
urls = [“[http://127.0.0.1:8086](http://127.0.0.1:8086)”]  
database = “servers”

Yet it’s writing to servers and telegraf databases. How do I make it just write to the servers database?

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [October 23, 2023, 9:09pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/2 "2023-10-23T21:09:18Z")

</div>

> [@skinfrakki](#):
>
> Yet it’s writing to servers and telegraf databases

Please provide the full telegraf log with debug.

Most likely you have a second influxdb v2 stanza somewhere or a second agent running somewhere that is writting there as well 😉

---

<div class="post-metadata">

**Author:** ![skinfrakki](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@skinfrakki](https://community.influxdata.com/u/skinfrakki)\
**Post date:** [October 24, 2023, 6:17pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/3 "2023-10-24T18:17:40Z")

</div>

No this is not the case. I have the following configured:

[[outputs.influxdb]]  
urls = [“[http://10.20.108.19:8086](http://10.20.108.19:8086)”]  
database = “snmp\_metrics”  
retention\_policy = “”  
write\_consistency = “any”  
timeout = “5s”  
namepass = [“snmp”]

I dropped the snmp measurement in the telegraf database. When I drop the snmp measurement from the telegraf database it recreates the measurement and still enters the same data in the snmp measurement in the telegraf database as the snmp\_metrics database. This is the only place snmp is configured for Telegraf to poll from

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [October 24, 2023, 6:24pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/4 "2023-10-24T18:24:08Z")

</div>

Please provide the logs with debug enabled

---

<div class="post-metadata">

**Author:** ![skinfrakki](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@skinfrakki](https://community.influxdata.com/u/skinfrakki)\
**Post date:** [October 24, 2023, 9:37pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/5 "2023-10-24T21:37:04Z")

</div>

I did but nothing but the MIBs are showing

---

<div class="post-metadata">

**Author:** ![skinfrakki](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@skinfrakki](https://community.influxdata.com/u/skinfrakki)\
**Post date:** [October 25, 2023, 7:28pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/6 "2023-10-25T19:28:22Z")

</div>

What should I be looking for in the logs?

---

<div class="post-metadata">

**Author:** ![skinfrakki](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@skinfrakki](https://community.influxdata.com/u/skinfrakki)\
**Post date:** [October 30, 2023, 3:43pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/7 "2023-10-30T15:43:08Z")

</div>

There’s nothing in the logs about what database it uses

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [October 30, 2023, 4:02pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/8 "2023-10-30T16:02:47Z")

</div>

If you want help you need to provide information. I have asked for logs twice, you did not provide them. You also did not provide your full config, so I have no idea what actually have configured for your scenario.

As I mentioned above this is commonly due to someone having a second v2 stanza in their config they didn’t realize was there. Telegraf is not going to suddenly start writing to a second database you haven’t configured.

Additional scenarios include:

- Accidently running telegraf manually with a different config and not realizing it
- Running telegraf manually or via a cron, but also running it as a service, or vis-versa
- Old versions of telegraf had a default influxdb stanza enabled

---

<div class="post-metadata">

**Author:** ![skinfrakki](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@skinfrakki](https://community.influxdata.com/u/skinfrakki)\
**Post date:** [October 30, 2023, 8:37pm UTC](https://community.influxdata.com/t/telegraf-writes-to-two-influxdb-databases-same-data/31920/9 "2023-10-30T20:37:26Z")

</div>

I would provide the logs you asked for if it was producing logs that are useful. The only thing is displaying are MIB objects. These cannot be passed due to security concerns
