telegraf输出json-> kafka->读jsontelegraf-> OpenTSDB输出为json

问题描述

很抱歉我的问题,但我不明白...

我想通过telegraf将我的所有机器和应用程序指标写入json作为kafka,然后从那里我想通过telegraf(kafka消费者json数据编解码器)再次读取它们,并将其推送到OpenTSDB或另一个TS。如何从json中的标签键中获取所有值作为标签

json示例,如下所示:

{
"fields": {
    "active": 0,"activePerOneMillion": 0,"cases": 3,"casesPerOneMillion": 200,"critical": 0,"criticalPerOneMillion": 0,"deaths": 0,"deathsPerOneMillion": 0,"oneCasePerPeople": 5010,"oneDeathPerPeople": 0,"oneTestPerPeople": 16,"population": 15029,"recovered": 3,"recoveredPerOneMillion": 199.61,"tests": 928,"testsPerOneMillion": 61747,"todayCases": 0,"todayDeaths": 0,"todayRecovered": 0,"updated": 1599765513087
},"name": "http","tags": {
    "continent": "north America","country": "Anguilla","countryInfo__id": "660","countryInfo_flag": "https://disease.sh/assets/img/flags/ai.png","countryInfo_iso2": "AI","countryInfo_iso3": "AIA","countryInfo_lat": "18.25","countryInfo_long": "-63.1667","host": "corona","url": "https://corona.lmao.ninja/v2/countries"
},"timestamp": 1599765690

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)