Hi,
I paste some part of my config:
[agent]
interval = "60s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "2s"
precision = ""
debug = false
quiet = true
logfile = ""
[[outputs.kafka]]
brokers = ["servers"]
topic = "telegraf-measurements-json"
client_id = "telegraf-hardware-measurements"
routing_tag = "host"
version = "0.11.0.2"
compression_codec = 2
required_acks = 1
data_format = "json"
[[inputs.exec]]
commands = ["/etc/infra-telegraf/telegraf_spawningtest.sh"]
name_suffix = "_spawningtest"
data_format = "json"
This is the script that I want to run:
#!/bin/bash
LINTIME=$(cat /var/tmp/linspawntime)
WINTIME=$(cat /var/tmp/winspawntime)
LINDELETETIME=$(cat /var/tmp/lindeletetime)
WINDELETETIME=$(cat /var/tmp/windeletetime)
LINSUCCESS=$(cat /var/tmp/linsuccesscounter)
WINSUCCESS=$(cat /var/tmp/winsuccesscounter)
LINFAILED=$(cat /var/tmp/linfailedcounter)
WINFAILED=$(cat /var/tmp/winfailedcounter)
SUMSUCCESS=$(cat /var/tmp/sumsuccesscounter)
LINSPAWNSUCCESS=$(cat /var/tmp/lss)
WINSPAWNSUCCESS=$(cat /var/tmp/wss)
LINSPAWNFAILED=$(cat /var/tmp/lsf)
WINSPAWNFAILED=$(cat /var/tmp/wsf)
LINDELETESUCCESS=$(cat /var/tmp/lds)
WINDELETESUCCESS=$(cat /var/tmp/wds)
LINDELETEFAILED=$(cat /var/tmp/ldf)
WINDELETEFAILED=$(cat /var/tmp/wdf)
echo "spawntest,linspawntime=$LINTIME winspawntime=$WINTIME lindeletetime=$LINDELETETIME windeletetime=$WINDELETETIME linsuccesscounter=$LINSUCCESS winsuccesscounter=$WINSUCCESS linfailedcounter=$LINFAILED winfailedcounter=$WINFAILED sumsuccesscounter=$SUMSUCCESS lss=$LINSPAWNSUCCESS wss=$WINSPAWNSUCCESS lsf=$LINSPAWNFAILED wsf=$WINSPAWNFAILED lds=$LINDELETESUCCESS wds=$WINDELETESUCCESS ldf=$LINDELETEFAILED wdf=$WINDELETEFAILED"
The values inside the files are integer simple number values like 34, 1,0
How can I send these values?
I don’t even sure that I should send as json.