Telegraf config

Hello community i have the issue below , i faced an issue with the tags.drop on config Telegraf

Lets me explains i have 2 db ,sys_metrics ans and heatlh_metrics
i would like to split the data on 2 outputs .
So i have setup 2 outputs like the documentation says…i have also two inputs [ jolokia plugins and system plugins] ,
So far soo good…

i have set my config like this for jolokia


sec-juju@Server telegraf.d]$ cat backend-server.conf 


[[inputs.jolokia2_agent]]
    urls = ["http://localhost:8706/backend-service"]

  [inputs.jolokia2_agent.tags]
    app_name = "backend-wtf"
    influxdb_database = "health_metrics"

  [[inputs.jolokia2_agent.metric]]
    name  = "health"
    mbean = "com.device.fr.backend.health:type=Health"

  [[inputs.jolokia2_agent.metric]]
    name  = "java_runtime"
    mbean = "java.lang:type=Runtime"
    paths = ["Uptime"]

and this my config telegraf for sys_metrics

sec-juju@Server telegraf]$ cat telegraf.conf 
global_tags]
  env_name = "qualif3"

[agent]
  interval = "30s"
  ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
  round_interval = true

  metric_batch_size = 1000
  metric_buffer_limit = 10000

  collection_jitter = "0s"

  flush_interval = "10s"
  flush_jitter = "0s"

  debug = true
  quiet = false
  #omit_hostname = false

  hostname = "appXXXX"


# --------OUTPUTS--------#
[outputs]

[[outputs.influxdb]]
  urls = [ "http://10.255.4.XXX:8086" ] # required
  database = "health_metrics" # required
  precision = "1m"
#  retention_policy = "autogen"
  timeout = "5s"
  username = "health_metric"
  password = "fffffff"
  [outputs.influxdb.tagpass]
     influxdb_database = ["health_metrics"]

[[outputs.influxdb]]
  urls = [ "http://10.255.4.XXX:8086" ] # required
  database = "sys_metrics" # required
  precision = "1m"
#  retention_policy = "autogen"
  timeout = "5s"
  username = "test_user"
  password = "fffffff"
  [outputs.influxdb.tagdrop]
     influxdb_database = ["*"]

#--------Telegraf Vault--------#

[[inputs.exec]]
  commands = ["/etc/telegraf/scripts/vault_metrics.sh"]
  timeout = "5s"
  name_override = "vault"
  name_suffix = ""

  data_format = "csv"
  csv_header_row_count = 0
  csv_column_names = ['state', 'int']
  csv_column_types = ['string', 'int']
  csv_tag_columns = ['state']

#--------PLUGINS--------#

[[inputs.kernel]]
[[inputs.kernel_vmstat]]
[[inputs.netstat]]
[[inputs.swap]]
[[inputs.processes]]
[[inputs.mem]]
[[inputs.system]]
[[inputs.cpu]]
    fielddrop = [ "time_*" ]
    totalcpu = true
    percpu = true
[[inputs.disk]]
[[inputs.diskio]]
    skip_serial_number = true
[[inputs.net]]
[[inputs.systemd_units]]

Every think works fine except i have also metric data [“health_metrics”] in sys_metrics ?

Does i mis understood something ??

julien

Try:

[outputs.influxdb.tagdrop]
     influxdb_database = ["health_metrics"]
2 Likes

it’s work thanks for your reply …