* MDF [etc/conf] update nanomq_rule_engine.conf.
+## supported format
## Select the message from the terminal whose username is 'abc', and the output will be all available fields:
-SELECT qos, username, clientid FROM "#" WHERE username = 'abc'
+## SELECT qos, username, clientid FROM "#" WHERE username = 'abc'
-SELECT * FROM "t/#"
+## SELECT * FROM "t/#"
-SELECT username FROM "#" WHERE username='Steven'
+## SELECT username FROM "#" WHERE username='Steven'
-SELECT clientid FROM "$events/session_subscribed" WHERE topic = 't/#' and qos = 1
+## SELECT qos, username, clientid FROM "t/#"
-SELECT qos, username, clientid FROM "t/#"
+## SELECT payload FROM "#" WHERE payload.x.y = 10
+
+## SELECT payload.x FROM "#" WHERE payload.x.y = 10
+
+## SELECT payload.x.y as y, payload.z as z FROM "#" WHERE y = 10 and z = 'str'
+
+## Select the message from the terminal whose username is 'abc', and the output will be all available fields:
+## SELECT qos, username, clientid FROM "#" WHERE username = 'abc'
+##
+## SELECT * FROM "t/#"
+## SELECT * FROM "abc"
+##
+## SELECT username FROM "#" WHERE username='Steven'
+##
+## SELECT clientid FROM "$events/session_subscribed" WHERE topic = 't/#' and qos = 1
+##
+## SELECT qos, username, clientid FROM "#"
-## TODO unsupport format for now
## Select the message sent from the terminal whose clientid is 'abc', and the output will have only one field of cid.
## Note that the cid variable is defined in the SELECT statement, so it can be used in the WHERE statement:
-## SELECT clientid as cid FROM "#" WHERE cid = 'abc'
-
-## SELECT clientid FROM "$events/session_subscribed" WHERE topic =~ 't/#' and qos = 1
+## SELECT username as u, payload as p, topic as t FROM "#" WHERE u = 'abc' and t = 'abc'
## SELECT payload FROM "#" WHERE payload.x = 1
-## SELECT payload FROM "#" WHERE payload.x.y = 1
-
## SELECT * FROM "t/a","t/b"
## Select the message sent from the terminal whose username is 'abc', and the output will have only one field of cid.
@@ -30,14 +42,16 @@ SELECT qos, username, clientid FROM "t/#"
## But the following SQL statement will not work, because the variable xyz is neither an available field in the message publishing event nor defined in the SELECT statement:
## SELECT clientid as cid FROM "#" WHERE xyz = 'abc'
-## TODO multi line parse
-## SELECT
-## from_clientid,
-## from_username,
-## topic,
-## qos,
-## node,
-## timestamp
-## FROM
-## "$events/message_delivered"
-
+```
+SELECT
+ clientid,
+ username,
+ topic,
+ qos,
+ timestamp
+FROM
+ "abc"
+```
+
+## TODO
+## SELECT clientid FROM "$events/session_subscribed" WHERE topic =~ 't/#' and qos = 1
\ No newline at end of file
