Save data to ClickHouse
Create the database:
create database test;
create table:
Create the rule:
Go to the EMQX Dashboard (opens new window), and type in the follwing SQL:
Add an action and select “Data to ClickHouse” from the dropdown list.
Provide the arguments of the action:
1). The resource id. We create a new clickhouse resource now:
Click “create” right to the resource Id text box, and then select “clickhouse” and fill in the following paramenters:
2). The SQL template. In this example we insert an message to clickhouse:
Keep all other arguments unchanged and confirm the action creation.
Then click “Create” to confirm the rule creation.
Now the rule has been created, we send an testing message to the broker:
And then we can verify if the message is inserted to the clickhouse table: