emqx/scripts/test/influx
Thales Macedo Garitezi 99796224d8 refactor(resource): rename `request_timeout` -> `request_ttl`
See
https://emqx.atlassian.net/wiki/spaces/P/pages/612368639/open+e5.1+remove+auto+restart+interval+from+buffer+worker+resource+options
2023-06-01 13:01:53 -03:00
..
certs test: add influx docker test certs 2023-01-24 13:58:37 +01:00
README.md test: add README to influxdb test script 2023-02-28 19:38:43 +01:00
docker-compose.yaml test: use EMQX_IMAGE_TAG for influx test script 2023-01-24 14:13:03 +01:00
emqx.conf refactor: stop creating emqx-enterprise.conf 2023-05-08 15:16:27 +02:00
influx-bridge.conf refactor(resource): rename `request_timeout` -> `request_ttl` 2023-06-01 13:01:53 -03:00
start.sh test: improve start.sh script for influxdb tests 2023-01-24 14:42:52 +01:00

README.md

Test influxdb integration

This script starts two EMQX nodes and a influxdb server in docker container. The bootstraping rule engine and data bridge config is provided in influx-bridge.conf which got included in the bootstraping config bundle emqx.conf.

Start the cluster

./start.sh

How to run tests

The rule and bridge are configured to pipe data from MQTT topic t/# to the 'myvalues' measurement in the 'mqtt' bucket.

Manual verification steps

  • Start the cluster
  • Send mqtt messages to topic /t/a with a JSON object as MQTT paylaod like {"value": 1}
  • Observe data in influxdb curl -k -H 'Authorization: Token abcdefg' -G 'https://localhost:8086/query?pretty=true' --data-urlencode "db=mqtt" --data-urlencode "q=SELECT * from myvalues"

Example output the curl query against influxdb:

{"results":[{"statement_id":0,"series":[{"name":"myvalues","columns":["time","clientid","value"],"values":[["2023-02-28T11:13:29.039Z","a1",123]]}]}]