json_exporter
json_exporter copied to clipboard
JSON key with space
{ "List": "1000000013-N-DN2804-N" "BrkList": "DN2804", "No of connected clients:": "1", "No of Socket Connections:": "37", "No of Socket Connected prop true:": "5", "REMARKS": "OK" }
I want to get value of "no of connected clients" can anyone pls help me ? thanks in advance
have a try,pls values: example: '{$["no of connected clients"]}'
Thanks but it didnt work for me
Not the nicest, but this seems to work. Notice that your JSON is missing a ,
, and many of the keys include :
metrics:
- name: connected_clients
type: value
path: "{$['No\\ of\\ connected\\ clients:']}"
i had the same issue,according to #114,i config like below and it works json:
{
"data": {
"FAN1": [
{
"Device": "FAN",
"Fan": "F1",
"Speed (RPM)": "9398.00",
"Status": "OK"
},
{
"Device": "FAN",
"Fan": "F2",
"Speed (RPM)": "8953.00",
"Status": "OK"
}
],
},
"executed_command": "show fan",
"status": "OK",
"status_message": ""
}
config:
metrics:
- name: speed_rpm
path: '{ .data.FAN1[0] }'
type: object
labels:
device: '{.Device}' # static label
values:
speed: '{.Speed\ (RPM)}'