>kafka->(读取json)telegraf->opentsdb(输出为json)

bvhaajcl  于 2021-06-04  发布在  Kafka
关注(0)|答案(0)|浏览(423)

对不起,我的问题,但我不明白。。。
我想通过telegraf将我的所有机器和应用程序度量作为json写入kafka,然后我想通过telegraf(kafka consumer json data codec)再次读取它们,并将其推送到opentsdb或其他ts。如何从json to be tags中的tags键获取所有值?
kafka中的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

}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题