Merge pull request #7963 from HJianBo/add-proto-name-for-client-disconnected-v5
feat(rule-engine): add proto_name/proto_ver for $event/client_disconnected event
This commit is contained in:
commit
4d35338cd1
|
@ -307,6 +307,8 @@ eventmsg_disconnected(
|
|||
ConnInfo = #{
|
||||
peername := PeerName,
|
||||
sockname := SockName,
|
||||
proto_name := ProtoName,
|
||||
proto_ver := ProtoVer,
|
||||
disconnected_at := DisconnectedAt
|
||||
},
|
||||
Reason
|
||||
|
@ -319,6 +321,8 @@ eventmsg_disconnected(
|
|||
username => Username,
|
||||
peername => ntoa(PeerName),
|
||||
sockname => ntoa(SockName),
|
||||
proto_name => ProtoName,
|
||||
proto_ver => ProtoVer,
|
||||
disconn_props => printable_maps(maps:get(disconn_props, ConnInfo, #{})),
|
||||
disconnected_at => DisconnectedAt
|
||||
}
|
||||
|
@ -844,6 +848,8 @@ columns_with_exam('client.disconnected') ->
|
|||
{<<"username">>, <<"u_emqx">>},
|
||||
{<<"peername">>, <<"192.168.0.10:56431">>},
|
||||
{<<"sockname">>, <<"0.0.0.0:1883">>},
|
||||
{<<"proto_name">>, <<"MQTT">>},
|
||||
{<<"proto_ver">>, 5},
|
||||
columns_example_props(disconn_props),
|
||||
{<<"disconnected_at">>, erlang:system_time(millisecond)},
|
||||
{<<"timestamp">>, erlang:system_time(millisecond)},
|
||||
|
|
Loading…
Reference in New Issue