|
@@ -0,0 +1,185 @@
|
|
|
+{
|
|
|
+ "data":[
|
|
|
+ {
|
|
|
+ "rawsql":"SELECT\n reason,\n clientid,\n username,\n peername,\n socketname\nFROM\n \"$events/client_connected\"",
|
|
|
+ "on_action_failed":"continue",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "speed_max":0,
|
|
|
+ "speed_last5m":0,
|
|
|
+ "speed":0,
|
|
|
+ "passed":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "no_result":0,
|
|
|
+ "matched":0,
|
|
|
+ "failed":0,
|
|
|
+ "exception":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"rule:012980",
|
|
|
+ "for":[
|
|
|
+ "$events/client_connected"
|
|
|
+ ],
|
|
|
+ "enabled":true,
|
|
|
+ "description":" 连接",
|
|
|
+ "actions":[
|
|
|
+ {
|
|
|
+ "params":{
|
|
|
+ "target_topic":"/sys/client/connected",
|
|
|
+ "target_qos":1,
|
|
|
+ "payload_tmpl":"{\"reason\":\"${reason}\",\"clientid\":\"${clientid}\",\"username\":\"${username}\",\"peername\":\"${peername}\",\"socketname\":\"${socketname}\"}"
|
|
|
+ },
|
|
|
+ "name":"republish",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "taken":0,
|
|
|
+ "success":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "failed":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"republish_16528854106752092",
|
|
|
+ "fallbacks":[
|
|
|
+
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "rawsql":"SELECT\n reason,\n clientid,\n username,\n peername,\n socketname\nFROM\n \"$events/client_disconnected\"",
|
|
|
+ "on_action_failed":"continue",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "speed_max":0,
|
|
|
+ "speed_last5m":0,
|
|
|
+ "speed":0,
|
|
|
+ "passed":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "no_result":0,
|
|
|
+ "matched":0,
|
|
|
+ "failed":0,
|
|
|
+ "exception":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"rule:377397",
|
|
|
+ "for":[
|
|
|
+ "$events/client_disconnected"
|
|
|
+ ],
|
|
|
+ "enabled":true,
|
|
|
+ "description":"断开连接",
|
|
|
+ "actions":[
|
|
|
+ {
|
|
|
+ "params":{
|
|
|
+ "target_topic":"/sys/client/disconnected",
|
|
|
+ "target_qos":0,
|
|
|
+ "payload_tmpl":"{\"reason\":\"${reason}\",\"clientid\":\"${clientid}\",\"username\":\"${username}\",\"peername\":\"${peername}\",\"socketname\":\"${socketname}\"}"
|
|
|
+ },
|
|
|
+ "name":"republish",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "taken":0,
|
|
|
+ "success":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "failed":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"republish_16528854190433372",
|
|
|
+ "fallbacks":[
|
|
|
+
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "rawsql":"SELECT\n clientid,\n username,\n topic,\n qos\nFROM\n \"$events/session_subscribed\"",
|
|
|
+ "on_action_failed":"continue",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "speed_max":0,
|
|
|
+ "speed_last5m":0,
|
|
|
+ "speed":0,
|
|
|
+ "passed":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "no_result":0,
|
|
|
+ "matched":0,
|
|
|
+ "failed":0,
|
|
|
+ "exception":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"rule:758695",
|
|
|
+ "for":[
|
|
|
+ "$events/session_subscribed"
|
|
|
+ ],
|
|
|
+ "enabled":true,
|
|
|
+ "description":"子设备注册成功后,订阅topic: /sys/{productKey}/{deviceName}/c/#",
|
|
|
+ "actions":[
|
|
|
+ {
|
|
|
+ "params":{
|
|
|
+ "target_topic":"/sys/session/subscribed",
|
|
|
+ "target_qos":1,
|
|
|
+ "payload_tmpl":"{\"username\":\"${username}\",\"topic\":\"${topic}\",\"qos\":\"${qos}\",\"clientid\":\"${clientid}\"}"
|
|
|
+ },
|
|
|
+ "name":"republish",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "taken":0,
|
|
|
+ "success":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "failed":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"republish_16530236276902029",
|
|
|
+ "fallbacks":[
|
|
|
+
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "rawsql":"SELECT\n clientid,\n username,\n topic,\n qos\nFROM\n \"$events/session_unsubscribed\"",
|
|
|
+ "on_action_failed":"continue",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "speed_max":0,
|
|
|
+ "speed_last5m":0,
|
|
|
+ "speed":0,
|
|
|
+ "passed":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "no_result":0,
|
|
|
+ "matched":0,
|
|
|
+ "failed":0,
|
|
|
+ "exception":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"rule:514503",
|
|
|
+ "for":[
|
|
|
+ "$events/session_unsubscribed"
|
|
|
+ ],
|
|
|
+ "enabled":true,
|
|
|
+ "description":"",
|
|
|
+ "actions":[
|
|
|
+ {
|
|
|
+ "params":{
|
|
|
+ "target_topic":"/sys/session/unsubscribed",
|
|
|
+ "target_qos":0,
|
|
|
+ "payload_tmpl":"{\"username\":\"${username}\",\"topic\":\"${topic}\",\"qos\":\"${qos}\",\"clientid\":\"${clientid}\"}"
|
|
|
+ },
|
|
|
+ "name":"republish",
|
|
|
+ "metrics":[
|
|
|
+ {
|
|
|
+ "taken":0,
|
|
|
+ "success":0,
|
|
|
+ "node":"emqx@127.0.0.1",
|
|
|
+ "failed":0
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "id":"republish_16530237303922829",
|
|
|
+ "fallbacks":[
|
|
|
+
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "code":0
|
|
|
+}
|