Commit Graph

89 Commits

Author SHA1 Message Date
Shawn
55fce33477 fix: add telemetry testcases in all/0 2022-05-25 21:55:28 +08:00
Shawn
a157539710 refactor(rule): rename http_bridge -> webhook 2022-05-25 18:56:12 +08:00
Shawn
71de9616d3 refactor(rule): rename outputs -> actions 2022-05-25 17:02:37 +08:00
Xinyu Liu
866810cea6
Merge pull request #8006 from emqx/copy-of-kjell/jq/timeout
feat(rule_engine): default timeout for jq/2 and jq/3 with timeout
2022-05-23 11:58:40 +08:00
EMQ-YangM
005fce63d1 feat: add rule engine function float2str/2 2022-05-19 16:16:05 +08:00
EMQ-YangM
66c62f432b fix: zero padding should be to the MSB side 2022-05-18 15:28:01 +08:00
Kjell Winblad
05032467bd feat(rule_engine): default timeout for jq/2 and jq/3 with timeout
This commit adds a default timeout of 10 seconds to the rule engine's
`jq/2` function, and adds a new function `jq/3` (where the last parameter is
a timeout value). The default timeout can be configured with the setting
"rule_engine.jq_function_default_timeout".

Having a timeout when executing jq code in the rule engine is important
as jq code can potentially run forever. Also, the Erlang jq library
limits the number of jq programs that can execute concurrently so a jq
program that loops forever could potentially also prevent a "non-buggy"
jq program from ever starting.
2022-05-17 19:36:32 +02:00
EMQ-YangM
d8da8f1686 fix: hexstr_to_bin support half byte 2022-05-17 16:47:59 +08:00
DDDHuang
5210cd6e8d fix(test): rule engine api SUITE , bad rule name 2022-05-12 18:01:37 +08:00
EMQ-YangM
685b06eeed fix: avoid 'rule_test' api crash 2022-05-05 17:28:59 +08:00
Kjell Winblad
74c33cd4e5 feat(rule_engine): add jq function to the rule engine
This commit adds a function to the rule engine that alows users
to transform text or JSON objects using [jq filter programs][1].

[jq][1] is a command line tool that can be used to transform
and filter JSON text using jq's built-in language. The rule engine
function that is added with this commit uses the
[Erlang jq NIF library][2] that wraps the jq C library in an
Erlang NIF function.

[1]: https://stedolan.github.io/jq/
[2]: https://github.com/emqx/jq
2022-05-04 17:09:16 +02:00
Zaiming (Stone) Shi
02c3f87b31 style: reformat all remaining apps 2022-04-27 15:51:18 +02:00
EMQ-YangM
1fac70d2bb fix: remove error field 2022-04-27 09:48:57 +08:00
EMQ-YangM
e4b62f3a5f feat: add rule-engine functions 2022-04-15 18:02:24 +08:00
EMQ-YangM
ee6ac90d47 fix: behavior of rule-engine when selection field does not exist 2022-04-13 18:19:42 +08:00
EMQ-YangM
fa0c4d17ee feat: impl rule_engine reset_metrics api 2022-04-11 10:25:48 +08:00
Thales Macedo Garitezi
1aea6b3ea7
Merge pull request #7522 from thalesmg/telemetry-revamp-part5
feat: add basic rule engine and bridge usage info to telemetry
2022-04-07 10:19:55 -03:00
Thales Macedo Garitezi
8354095e4b
feat(rules): export basic usage info for telemetry 2022-04-06 10:20:23 -03:00
EMQ-YangM
a31891e8e6 feat: enhanced rule engine error handling when json parsing error 2022-04-06 09:56:55 +08:00
Thales Macedo Garitezi
ed7035ec41
style(bridge): please elvis checks 2022-04-05 15:59:50 -03:00
EMQ-YangM
ccc134d061 fix(emqx_rule_api_schema): add rule events schema 2022-03-29 14:03:15 +08:00
EMQ-YangM
4791c64b73 feat: add rule event 'client.check_authz_complete' 2022-03-29 11:24:36 +08:00
EMQ-YangM
65164fb046 feat: add rule event 'client.connack' 2022-03-28 11:32:07 +08:00
Shawn
b69dca4f08 feat(rule): add testcase for '/delivery_dropped' 2022-02-08 20:37:40 +08:00
Kian-Meng Ang
fc92e4c8bf docs: fix typos 2022-01-27 12:29:38 +01:00
Zaiming (Stone) Shi
2105d1f22b test: call ct helpers to load config 2022-01-25 11:50:18 +01:00
Shawn
8cee9a9e47 fix(rule): compare to null variables should return false 2022-01-17 14:17:49 +08:00
Zaiming (Stone) Shi
63167cea70 chore: update copyright 2022-01-05 20:55:00 +01:00
Shawn
affe69afd6 fix(rules): update the test cases for rule APIs 2021-12-07 09:48:47 +08:00
Ilya Averyanov
ea0fa24ce5 chore(ct): remove verbose output during tests 2021-11-25 18:30:50 +03:00
Shawn
4c149f92c1 feat(bridge): support metrics for bridges 2021-11-23 09:36:10 +08:00
JimMoen
dcc5ae0642 test: API return code section 2021-11-15 16:30:44 +08:00
zhongwencool
d784e63b9f
emqx_conf (#5939)
* feat(emqx_conf): move conf manager for emqx_machine to emqx_conf

* chore(emqx_conf): change emqx:get_config/2 to emqx_conf:get/2

* fix: common test failed

* fix: badmatch by typo wrong key

* fix(emqx_conf): get the wrong core nodes

* fix(emqx_conf): get core node's tnx_id not latest tnx_id

* fix: add ro_transation when copy conf file

* fix: delete debug info

* fix: change ekka_rlog to mria_rlog

* fix: remove cluster_rpc from emqx_machine.

* fix: don't call ekka:start/0 explicitly

* fix: ekka should be start in emqx_machine
2021-10-21 18:08:51 +08:00
Tobias Lindahl
aa19c2a908 chore: Remove emqx_ct_helpers as dependency 2021-10-15 10:40:57 +02:00
Shawn
0e7a3f89a9 feat(rules): support output functions in <<"Mod:Func">> format 2021-10-14 15:09:37 +08:00
Shawn
9c7eef5295 feat(rules): update rule_engine configs from APIs 2021-10-14 15:09:37 +08:00
Shawn
1ffae5d1b0 refactor(rule_engine): merge code for emqx_rule_registry and emqx_rule_engine 2021-10-14 15:09:37 +08:00
Shawn
b063b6f253 feat(rules): support configure rules in config file 2021-10-14 15:09:37 +08:00
lafirest
3524942766 fix: change all ~s in io format to ~ts
we should use unicode to replace latin1
2021-10-12 15:09:24 +08:00
Shawn
0d26e50e87 fix(rules): parse outputs failed 2021-09-26 23:00:08 +08:00
Shawn
420ccf0f51 refactor(rules): change republish as an output 2021-09-26 23:00:08 +08:00
Shawn
f33e28af6d fix(rules): update test cases for emqx_rule_engine_SUITE 2021-09-26 23:00:08 +08:00
Shawn
7bc69b129a fix(rules): update test cases for rule metrics 2021-09-26 23:00:08 +08:00
Shawn
af295a9b71 refactor(rules): remove resources and actions 2021-09-26 23:00:08 +08:00
Shawn
b055464f6b refactor(rule): remove CLIs for rules
We will have new CLIs based on HTTP API in the future.
2021-09-26 23:00:08 +08:00
Shawn
d46241fe2f feat(bridges): avoid clientid competition between bridges on different nodes 2021-09-10 14:21:17 +08:00
Shawn
1dae970cd3 refactor(rule): move emqx_rule_utils.erl -> emqx_plugin_libs_rule.erl 2021-09-10 11:43:03 +08:00
zhongwencool
73238ed81f feat: emqx_resource support cluster_call 2021-08-26 17:23:39 +08:00
zhongwencool
e5129ead6d fix(CI): Error detected: 'Invalid reference to group api in emqx_rule_engine_SUITE:all/0' 2021-08-26 17:17:47 +08:00
DDDHuang
c11a8c6db6 refactor: clients api; status api; adapter minirest v1
The serious influence:

authn:
    api
authz:
    api; api test suit
dashboard:
    all closed
lwm2m:
    api;
modules:
    api(api_topic_metrics, modules_api); test suit(emqx_modules_SUITE)
prometheus:
    api
retainer:
    api; api test suit
rule_engine:
    api: api test suit
telemetry:
    api
2021-07-09 18:09:07 +08:00