Hi @loneWolf666, happy new year! I hope it was a good one. Is there a reason why you would want to do this? You could filter the JSON message in Telegraf but it would be good to understand why.
Hi @Jay_Clifford
Can you help me see the problem of broken chain?
Hi @loneWolf666
I believe this is the issue Josh was trying to help you solve. So If I understand correctly the new issue being faced is the invalid character ‘N’. Can you provide a sample JSON payload coming from this topic? Normally this occurs when the JSON parser receives invalid json.
################## error #################
2022-01-12T07:11:54Z E! [inputs.mqtt_consumer] Error in plugin: connection lost: pingresp not received, disconnecting
Hi,@Jay_Clifford
What is the reason for the abnormality of the broken chain,It bothered me for a long time,Increasing the refresh time does not take effect
This might be an underlying issue with the Broker/client library as I have seen this error pop up on other projects before. Can you remind me:
- What version of Telegraf are you running?
- What MQTT broker and version are you running?
Hi ,@Jay_Clifford
How do array nested JSON structures match string fields?
{
"name":"A002",
"updated_at":1640238730.9187334,
"system":{
"mem":{
"percent":6.8
},
"cpu":{
"percent":14.7
},
"timestamp":1640238729.500403,
"disk":{
"percent":77.3
},
"processes":[
{
"cpu_percent":23.4,
"name":"xpnd_node",
"cmdline":[
"/home/trunk/art/pncc/install/lib/xpnd/xpnd_node",
"__name:=xpnd_node",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/xpnd_node-1.log"
],
"pid":29643,
"memory_percent":0.13968542471421713,
"status":"sleeping"
},
{
"cpu_percent":20.5,
"name":"hadmap_server_node",
"cmdline":[
"/home/trunk/art/map/install/lib/hadmap_server/hadmap_server_node",
"__name:=hadmap_server_node",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/hadmap_server_node-1.log"
],
"pid":29441,
"memory_percent":1.2805839455958947,
"status":"sleeping"
},
{
"cpu_percent":18.5,
"name":"rosout",
"cmdline":[
"/opt/ros/kinetic/lib/rosout/rosout",
"__name:=rosout",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/rosout-1.log"
],
"pid":2639,
"memory_percent":0.07901841460947504,
"status":"sleeping"
},
{
"cpu_percent":18,
"name":"vdcs",
"cmdline":[
"/home/trunk/art/tool/monitor/vdcs",
"--name",
"A002",
"--push",
"mq",
"--rate",
"10"
],
"pid":28548,
"memory_percent":0.1484706715515893,
"status":"sleeping"
},
{
"cpu_percent":13.2,
"name":"rosmaster",
"cmdline":[
"/usr/bin/python",
"/opt/ros/kinetic/bin/rosmaster",
"--core",
"-p",
"11311",
"-w",
"3",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/master.log"
],
"pid":2356,
"memory_percent":0.1762906198699344,
"status":"sleeping"
},
{
"cpu_percent":9.8,
"name":"xcontrol_node",
"cmdline":[
"/home/trunk/art/pncc/install/lib/xcontrol/xcontrol_node",
"__name:=xcontrol_node",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/xcontrol_node-1.log"
],
"pid":30080,
"memory_percent":0.053931654196090126,
"status":"sleeping"
},
{
"cpu_percent":8.8,
"name":"record",
"cmdline":[
"/opt/ros/kinetic/lib/rosbag/record",
],
"pid":1494,
"memory_percent":0.18606420697651094,
"status":"sleeping"
},
{
"cpu_percent":7.3,
"name":"ins550_driver_node",
"cmdline":[
"/home/trunk/art/drv/ins550_driver/install/lib/ins550_driver/ins550_driver_node",
"__name:=ins550_driver_node",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/ins550_driver_node-1.log"
],
"pid":29209,
"memory_percent":0.03716647481477161,
"status":"sleeping"
},
{
"cpu_percent":6.8,
"name":"tpa",
"cmdline":[
"./tpa"
],
"pid":29102,
"memory_percent":0.24186272612554266,
"status":"sleeping"
},
{
"cpu_percent":6.3,
"name":"chassis_node",
"cmdline":[
"/home/trunk/art/pncc/install/lib/chassis/chassis_node",
"__name:=chassis_node",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/chassis_node-1.log"
],
"pid":29338,
"memory_percent":0.034628514617308544,
"status":"sleeping"
},
{
"cpu_percent":4.4,
"name":"tmux",
"cmdline":[
"/usr/bin/tmux",
"new-session",
"-d",
"-s",
"master"
],
"pid":27948,
"memory_percent":0.0694766604055514,
"status":"sleeping"
},
{
"cpu_percent":2.9,
"name":"aeb_node",
"cmdline":[
"/home/trunk/art/pncc/install/lib/aeb/aeb_node",
"__name:=aeb_node",
"__log:=/root/.ros/log/ff2828d6-5f3b-11ec-8623-2c534a092730/aeb_node-1.log"
],
"pid":29297,
"memory_percent":0.08021418431789512,
"status":"sleeping"
},
{
"cpu_percent":0.5,
"name":"rcu_sched",
"cmdline":[
],
"pid":8,
"memory_percent":0,
"status":"?"
},
{
"cpu_percent":0.5,
"name":"kworker/u16:1",
"cmdline":[
],
"pid":9229,
"memory_percent":0,
"status":"?"
},
{
"cpu_percent":0.5,
"name":"kworker/0:0",
"cmdline":[
],
"pid":12965,
"memory_percent":0,
"status":"?"
},
{
"cpu_percent":0.5,
"name":"kworker/u16:2",
"cmdline":[
],
"pid":13123,
"memory_percent":0,
"status":"?"
},
{
"cpu_percent":0.5,
"name":"roslaunch",
"cmdline":[
"/usr/bin/python",
"/opt/ros/kinetic/bin/roslaunch",
"--wait",
"hadmap_server",
"hadmap_server.launch"
],
"pid":28810,
"memory_percent":0.16596795483602214,
"status":"sleeping"
},
{
"cpu_percent":0.5,
"name":"roslaunch",
"cmdline":[
"/usr/bin/python",
"/opt/ros/kinetic/bin/roslaunch",
"--wait",
"aeb",
"aeb.launch"
],
"pid":28834,
"memory_percent":0.16573612193336926,
"status":"sleeping"
}
]
}
}
I tried to parse the ‘name’ and ‘CmdLine’ string fields under the “processes” structure of the process. Both gjson and “syetem_processes_name” failed