# Telegraf not posting data to multiple Databases on Same Influxdb

**URL:** <https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733>\
**Category:** Systems\
**Tags:** influxdb, telegraf\
**Created:** [April 26, 2017, 2:44pm UTC](https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733 "2017-04-26T14:44:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpalanivelu](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kpalanivelu](https://community.influxdata.com/u/kpalanivelu)\
**Post date:** [April 26, 2017, 2:44pm UTC](https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733/1 "2017-04-26T14:44:40Z")

</div>

Hi,

I am passing all the collected metrics from JVM to jvmstats and Docker Metrics to dockerstats which is hosted on same Influxdb instance. Below are my configurations: I am facing below issues:

1. If I say SHOW MEASUREMENTS on dockerstats it is empty. But in jvmstats it shows all including docker measurements
2. Only docker metrics make out to the dockerstats or I can do the same using jvmstats as the measurements are available here.
3. JVM metrics is getting dropped or not made it to the database.

###############################################################################

# OUTPUTS - JVM

###############################################################################

# Configuration for influxdb server to send metrics to

[[outputs.influxdb]]

## The full HTTP or UDP endpoint URL for your InfluxDB instance.

## Multiple urls can be specified as part of the same cluster,

## this means that only ONE of the urls will be written to each interval.

# urls = [“udp://localhost:8089”] # UDP endpoint example

urls = [“[http://HOST](http://HOST):PORT”] # required

## The target database for metrics (telegraf will create it if not exists).

database = “jvmstats” # required

## Retention policy to write to.

retention\_policy = “”

## Precision of writes, valid values are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”.

## note: using “s” precision greatly improves InfluxDB compression.

precision = “s”

## Write timeout (for the InfluxDB client), formatted as a string.

## If not provided, will default to 5s. 0s means no timeout (not recommended).

timeout = “5s”  
username = “admin”  
password = “admin”

## Set the user agent for HTTP POSTs (can be useful for log differentiation)

# user\_agent = “telegraf”

## Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)

# udp\_payload = 512

## Optional SSL Config

# ssl\_ca = “/etc/telegraf/ca.pem”

# ssl\_cert = “/etc/telegraf/cert.pem”

# ssl\_key = “/etc/telegraf/key.pem”

## Use SSL but skip chain & host verification

# insecure\_skip\_verify = false

namedrop = [“container\_\*”,“_docker\__”,“_engine_”]

###############################################################################

# OUTPUTS - Docker

###############################################################################

# Configuration for influxdb server to send metrics to

[[outputs.influxdb]]

## The full HTTP or UDP endpoint URL for your InfluxDB instance.

## Multiple urls can be specified as part of the same cluster,

## this means that only ONE of the urls will be written to each interval.

# urls = [“udp://localhost:8089”] # UDP endpoint example

urls = [“[http://HOST](http://HOST):PORT”] # required

## The target database for metrics (telegraf will create it if not exists).

database = “dockerstats” # required

## Retention policy to write to.

retention\_policy = “”

## Precision of writes, valid values are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”.

## note: using “s” precision greatly improves InfluxDB compression.

precision = “s”

## Write timeout (for the InfluxDB client), formatted as a string.

## If not provided, will default to 5s. 0s means no timeout (not recommended).

timeout = “5s”  
username = “admin”  
password = “admin”

## Set the user agent for HTTP POSTs (can be useful for log differentiation)

# user\_agent = “telegraf”

## Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)

# udp\_payload = 512

## Optional SSL Config

# ssl\_ca = “/etc/telegraf/ca.pem”

# ssl\_cert = “/etc/telegraf/cert.pem”

# ssl\_key = “/etc/telegraf/key.pem”

## Use SSL but skip chain & host verification

# insecure\_skip\_verify = false

namedrop = [“jolokia\*”]

Any help is appreciated.

Thanks in advance  
Karthik

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [April 26, 2017, 5:12pm UTC](https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733/2 "2017-04-26T17:12:00Z")

</div>

@kpalanivelu Without seeing your input configuration I can’t make a determination as to what is going on here. Have you tried splitting this config into 2 telegraf instances?

---

<div class="post-metadata">

**Author:** ![kpalanivelu](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kpalanivelu](https://community.influxdata.com/u/kpalanivelu)\
**Post date:** [April 26, 2017, 5:20pm UTC](https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733/3 "2017-04-26T17:20:28Z")

</div>

I tried running two instances of telegraf with two configs. It works. I am wondering, can I do it with one conf file.

Inputs for your review:

###############################################################################

# INPUT PLUGINS

###############################################################################

# # Read metrics about docker containers

[[inputs.docker]]  
endpoint = "ENV"  
container\_names = []  
timeout = "5s"  
perdevice = true  
total = false

###############################################################################

# INPUT PLUGINS

###############################################################################

# # Read JMX metrics through Jolokia

[[inputs.jolokia]]  
context = “/read”

[[inputs.jolokia.servers]]  
name = "IP"  
host = "CONTAINER"  
port = “8080”

# ## List of metrics collected on above servers

# ## Each metric consists in a name, a jmx path and either

# ## a pass or drop slice attribute.

# ## This collect all heap memory usage metrics.

[[inputs.jolokia.metrics]]  
name = "heap\_memory\_usage"  
mbean = "java.lang:type=Memory"  
attribute = “Verbose,ObjectPendingFinalizationCount,NonHeapMemoryUsage”

# ## This collect thread counts metrics.

[[inputs.jolokia.metrics]]  
name = "thread\_count"  
mbean = "java.lang:type=Threading"  
attribute = “TotalStartedThreadCount,ThreadCount,DaemonThreadCount,PeakThreadCount”

# ## This collect number of class loaded/unloaded counts metrics.

[[inputs.jolokia.metrics]]  
name = "class\_count"  
mbean = "java.lang:type=ClassLoading"  
attribute = “LoadedClassCount,UnloadedClassCount,TotalLoadedClassCount”

# ## This collect number of GC.

[[inputs.jolokia.metrics]]  
name = "GC-MarkSweep"  
mbean = "java.lang:name=PS MarkSweep,type=GarbageCollector"  
attribute = “LastGcInfo,CollectionCount,CollectionTime,Valid”

# ## This collect number of GC.

[[inputs.jolokia.metrics]]  
name = "GC-Scavenge"  
mbean = "java.lang:name=PS Scavenge,type=GarbageCollector"  
attribute = “LastGcInfo,CollectionCount,CollectionTime,Valid”

---

<div class="post-metadata">

**Author:** ![kpalanivelu](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kpalanivelu](https://community.influxdata.com/u/kpalanivelu)\
**Post date:** [April 27, 2017, 12:57pm UTC](https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733/4 "2017-04-27T12:57:38Z")

</div>

Please advise if this is the recommended approach for two different input plugins to same output different databases:

nohup /telegraf/usr/bin/telegraf -config /opt/telegraf/telegraf.conf \> /dev/null 2\>/var/log/telegraf/telegraf.log &  
nohup /telegraf/usr/bin/telegraf -config /opt/telegraf/telegraf-docker.conf \> /dev/null 2\>/var/log/telegraf/telegraf-docker.log &

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [April 27, 2017, 5:15pm UTC](https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733/5 "2017-04-27T17:15:20Z")

</div>

It should not be required to use two instances, what version of Telegraf are you using?

---

<div class="post-metadata">

**Author:** ![kpalanivelu](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kpalanivelu](https://community.influxdata.com/u/kpalanivelu)\
**Post date:** [April 27, 2017, 7:55pm UTC](https://community.influxdata.com/t/telegraf-not-posting-data-to-multiple-databases-on-same-influxdb/733/6 "2017-04-27T19:55:02Z")

</div>

I am using 1.1.2 of the telegraf
