emqx:5.3.2,开源版本,使用了webhook设备上线后,访问webhook的url,直接输出(直接全部输出),s设备下线也是
收到Webhook请求: {
headers: {
‘content-length’: ‘346’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘MQTT’, version: ‘4’ },
connected_at: ‘1747062348147’,
disconnected_at: ‘undefined’,
reason: ‘undefined’
}
}
POST /emqx_web_hook 200 19.560 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘342’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘MQTT’, version: ‘4’ },
connected_at: ‘undefined’,
disconnected_at: ‘undefined’,
reason: ‘undefined’
}
}
POST /emqx_web_hook 200 3.013 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘346’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘MQTT’, version: ‘4’ },
connected_at: ‘undefined’,
disconnected_at: ‘1747062348147’,
reason: ‘takenover’
}
}
POST /emqx_web_hook 200 4.420 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘353’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘publish’,
ip: ‘undefined’,
protocol: { name: ‘undefined’, version: ‘undefined’ },
connected_at: ‘undefined’,
disconnected_at: ‘undefined’,
reason: ‘undefined’
}
}
POST /emqx_web_hook 200 6.185 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘355’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘undefined’, version: ‘undefined’ },
connected_at: ‘undefined’,
disconnected_at: ‘undefined’,
reason: ‘undefined’
}
}
POST /emqx_web_hook 200 4.410 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘360’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘undefined’, version: ‘undefined’ },
connected_at: ‘undefined’,
disconnected_at: ‘undefined’,
reason: ‘no_subscribers’
}
}
POST /emqx_web_hook 200 4.316 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘353’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘publish’,
ip: ‘undefined’,
protocol: { name: ‘undefined’, version: ‘undefined’ },
connected_at: ‘undefined’,
disconnected_at: ‘undefined’,
reason: ‘undefined’
}
}
POST /emqx_web_hook 200 4.487 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘355’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘undefined’, version: ‘undefined’ },
connected_at: ‘undefined’,
disconnected_at: ‘undefined’,
reason: ‘undefined’
}
}
POST /emqx_web_hook 200 5.060 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘360’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘undefined’, version: ‘undefined’ },
connected_at: ‘undefined’,
disconnected_at: ‘undefined’,
reason: ‘no_subscribers’
}
}
POST /emqx_web_hook 200 4.060 ms - 2
收到Webhook请求: {
headers: {
‘content-length’: ‘343’,
host: ‘127.0.0.1:3000’,
‘content-type’: ‘application/json’
},
body: {
username: ‘IotApp/nFN8_yX9bP’,
ts: ‘undefined’,
clientid: ‘IotApp/nFN8_yX9bP’,
topic: ‘$SYS/brokers/+/clients/#’,
action: ‘undefined’,
ip: ‘undefined’,
protocol: { name: ‘MQTT’, version: ‘4’ },
connected_at: ‘undefined’,
disconnected_at: ‘1747062353156’,
reason: ‘normal’
}
},
这是 Payload:
{
“username”: “${username}”,
“ts”: “${ts}”,
“clientid”: “${clientid}”,
“topic”: “$SYS/brokers/+/clients/#”,
“action”: “${action}”,
“ip”: “${ipaddress}”,
“protocol”: {
“name”: “${proto_name}”,
“version”: “${proto_ver}”
},
“connected_at”: “${connected_at}”,
“disconnected_at”: “${disconnected_at}”,
“reason”: “${reason}”
}