Hi , i am not much familiar with influxDB and telegraf. I need to push json data shown below to influxDB 2.0 bucket , what would be the best way to do it ?
JSON:
{
“clock”: 1723533395,
“groups”: [
“Demo”,
“Linux servers”
],
“host”: {
“host”: “AppServer3”,
“name”: “AppServer3”
},
“item_tags”: [
{
“tag”: “component”,
“value”: “cpu”
},
{
“tag”: “item”,
“value”: “kafka”
}
],
“itemid”: 119375,
“name”: “CPU iowait time”,
“ns”: 554388791,
“type”: 0,
“value”: 0.016861
}
[[inputs.kafka_consumer]]
brokers = [“10.10.10.12:9092”]
topics = [“zabbixitem”]
json_name_key = “itemid” # Use this key to determine measurement name (if necessary)
json_time_key = “clock” # Field containing the timestamp
json_time_format = “unix” # Use ‘unix’ or ‘unix_ms’ depending on the timestamp precision
json_string_fields = [“clock”, “itemid”, “name”, “value”]
data_format = json
I tried the above using telegraf but i am getting individual fields and their values. I want to get them all in a single row in a table. How can it do that? Thanks.