Kuiper has implemented the following plugins. At present, some of these plug-ins are examples used to describe the plug-in development process, and some are contributed by community developers. Please read the relevant documents carefully before using the plugins.

Developers of Kuiper plugin can specify metadata files during the development process. These metadata files are mainly used in the following aspects:

  • Plugin compilation: For plugins in the directories plugins/sinks and plugins/sources, if the developer provides related metadata files, Kuiper will automatically compile the plugins when the version is released, and then automatically upload these plugins to the EMQ plugin download website: www.emqx.io/downloads/kuiper/vx.x.x/plugins, where x.x.x is the version number.

    Note: Due to the limitations of Golang plugins, these automatically compiled plugins can run in the container of the corresponding version released by Kuiper. However, for the directly downloaded binary installation package, or the binary package compiled by the user , these downloaded plugins are not guaranteed to work properly.

  • Visualization: from version 0.9.1, Kuiper will release the management console synchronously with the version, which can be used to manage Kuiper nodes, streams, rules, and plugins. Plugin metadata provided by developers can make it more convenient for users to use plugins. Therefore, it is strongly recommended that plugin developers provide corresponding metadata files when submitting plugins. The metadata file is in JSON format. The file name is consistent with that of the plugin and is placed in the root directory of the compressed package together with the plugin.

Sources

NameDescriptiomRemarks
zmqThe plugin listens to Zero Mq messages and sends them to the Kuiper streamSample of plugin, not available in production environment
randomThe plugin generates messages according to the specified patternSample of plugin, not available in production environment

source metadata file format

Most attributes of source are specified by the user through the corresponding configuration file, and the user cannot configure it during the creation of the stream. In the metadata file provided by the plugin developer, only the following parts need to be specified.

libs

This part of the content defines which library dependencies are used by the plugin (the format is github.com/x/y@version). During the compilation of the plugin, this information is read and the relevant library dependencies are added to the go.mod of the project. The content of this configuration item is a string array.

about

  • trial: indicates whether the plugin is under beta test stage

  • author

    This part contains the author information of the plugin. The plugin developer can provide this information as appropriate. The information of this part will be displayed in the plugin information list of the management console.

    • name
    • email
    • company
    • website
  • helpUrl

    The help file address of the plug-in. The console will link to the corresponding help file according to the language support.

    • en_US: English document help address
    • zh_CN: Chinese document help address
  • description

    A simple description of the plugin. The console supports multiple languages.

    • en_US: English description
    • zh_CN: Chinese description

properties

The list of attributes supported by the plugin and the configuration related to each attribute.

  • name: attribute name; This field must be provided;

  • default: default value, which is used to set the default value of the attribute. The type can be numbers, characters, boolean, and so on. This field is optional (can be nested);

  • optional: set whether the attribute must be provided; the field is optional, if not provided, it is true, indicating that the user can provide the value of the field;

  • control: control type, which control the type of control displayed in the interface; This field must be provided;

    • text: text input box
    • text-area: text editing area
    • list: list box
    • radio: radio box
  • Helpurl: if you have more detailed help on this property, you can specify it here; this field is optional;

    • en_US: English document help address
    • zh_CN: Chinese document help address
  • Hint: prompt information of the control; this field is optional;

    • en_US
    • zh_CN
  • label: The label control targeted by the control; This field must be provided;

    • en_US
    • zh_CN
  • type: field type; This field must be provided;

    • string
    • float
    • int
    • list_object: list, element is structure
    • list_string: list, elements is string
  • values: If the control type is list-box or radio, this field must be provided;

  • Array: The data type can be number, character, boolean, etc.

Sample file

The following is a sample of metadata file.

  1. {
  2. "libs": [""],
  3. "about": {
  4. "trial": false,
  5. "author": {
  6. "name": "",
  7. "email": "",
  8. "company": "",
  9. "website": ""
  10. },
  11. "helpUrl": {
  12. "en_US": "",
  13. "zh_CN": ""
  14. },
  15. "description": {
  16. "en_US": "",
  17. "zh_CN": ""
  18. }
  19. },
  20. "properties": {
  21. "default": [{
  22. "name": "",
  23. "default": "",
  24. "optional": false,
  25. "control": "",
  26. "type": "",
  27. "hint": {
  28. "en_US": "",
  29. "zh_CN": ""
  30. },
  31. "label": {
  32. "en_US": "",
  33. "zh_CN": ""
  34. }
  35. }, {
  36. "name": "",
  37. "default": [{
  38. "name": "",
  39. "default": "",
  40. "optional": false,
  41. "control": "",
  42. "type": "",
  43. "hint": {
  44. "en_US": "",
  45. "zh_CN": ""
  46. },
  47. "label": {
  48. "en_US": "",
  49. "zh_CN": ""
  50. }
  51. }],
  52. "optional": false,
  53. "control": "",
  54. "type": "",
  55. "hint": {
  56. "en_US": "",
  57. "zh_CN": ""
  58. },
  59. "label": {
  60. "en_US": "",
  61. "zh_CN": ""
  62. }
  63. }]
  64. }
  65. }

Sinks/Actions

NameDescriptionRemarks
fileThe plugin saves the analysis results to a specified file systemSample of plugin, not available in production environment
zmqThe plugin sends the analysis results to the topic of Zero MqSample of plugin, not available in production environment
InfluxdbThe plugin sends the analysis results to InfluxDBProvided by @smart33690Introduction - 图1 (opens new window)
TDengineThe plugin sends the analysis results to TDengine

sink metadata file format

The metadata file format is JSON and is mainly divided into the following parts:

libs

The content of this part defines which library dependencies are used by the plugin (the format is github.com/x/y@version). During the compilation of the plugin, this information is read and the relevant library dependencies are added to the go.mod of the project. The content of this configuration item is a string array.

about

  • trial: indicates whether the plugin is under beta test stage

  • author

    This part contains the author information of the plugin. The plugin developer can provide this information as appropriate. The information of this part will be displayed in the plugin information list of the management console.

    • name
      • email
      • company
      • website
  • helpUrl

    The help file address of the plugin. The console will link to the corresponding help file according to the language support.

    • en_US: English document help address
    • zh_CN: Chinese document help address
  • description

    A simple description of the plugin. The console supports multiple languages.

    • en_US: English description
    • zh_CN: Chinese description

properties

The list of attributes supported by the plugin and the configuration related to each attribute.

  • name: attribute name; This field must be provided;

  • default: default value, which is used to set the default value of the attribute. The type can be numbers, characters, boolean, and so on. This field is optional (can be nested);

  • optional: set whether the attribute must be provided; the field is optional, if not provided, it is true, indicating that the user can provide the value of the field;

  • control: control type, which control the type of control displayed in the interface; This field must be provided;

    • text: text input box
    • text-area: text editing area
    • list: list box
    • radio: radio box
  • Helpurl: if you have more detailed help on this property, you can specify it here; this field is optional;

    • en_US: English document help address
    • zh_CN: Chinese document help address
  • Hint: prompt information of the control; this field is optional;

    • en_US
    • zh_CN
  • label: The label control targeted by the control; This field must be provided;

    • en_US
    • zh_CN
  • type: field type; This field must be provided;

    • string
    • float
    • int
    • list_object: list, element is structure
    • list_string: list, elements is string
    • list_float: list, elements is float
    • list_int: list, elements is int
  • values: If the control type is list-box or radio, this field must be provided;

  • Array: The data type can be number, character, boolean, etc.

Sample file

The following is a sample of metadata file.

  1. {
  2. "about": {
  3. "trial": false,
  4. "author": {
  5. "name": "",
  6. "email": "",
  7. "company": "",
  8. "website": ""
  9. },
  10. "helpUrl": {
  11. "en_US": "",
  12. "zh_CN": ""
  13. },
  14. "description": {
  15. "en_US": "",
  16. "zh_CN": ""
  17. }
  18. },
  19. "libs": [""],
  20. "properties": [{
  21. "name": "",
  22. "default": "",
  23. "optional": false,
  24. "control": "",
  25. "type": "",
  26. "hint": {
  27. "en_US": "",
  28. "zh_CN": ""
  29. },
  30. "label": {
  31. "en_US": "",
  32. "zh_CN": ""
  33. }
  34. }]
  35. }

Functions

NameDescriptionRemarks
echoOutput parameter value as it isPlugin sample, not available for production environment
countPlusOneOutput the value of the parameter length plus onePlugin sample, not available for production environment
accumulateWordCountThe function counts how many words there arePlugin sample, not available for production environment
resizeCreate a scaled image with new dimensions (width, height). If width or height is set to 0, it is set to the reserved value of aspect ratioPlugin sample, not available for production environment
thumbnailReduce the image that retains the aspect ratio to the maximum size (maxWidth, maxHeight).Plugin sample, not available for production environment

Kuiper has many built-in functions that can perform calculations on data. (Refer to https://github.com/emqx/kuiper/blob/master/docs/zh\_CN/sqls/built-in\_functions.md for specific documentation)

functions metadata file format

The metadata file format is JSON and is mainly divided into the following parts:

about

  • trial: indicates whether the plugin is under beta test stage

  • author

    This part contains the author information of the plugin. The plugin developer can provide this information as appropriate. The information of this part will be displayed in the plugin information list of the management console.

    • name
      • email
      • company
      • website
  • helpUrl

    The help file address of the plugin. The console will link to the corresponding help file according to the language support.

    • en_US: English document help address
    • zh_CN: Chinese document help address
  • description

    A simple description of the plugin. The console supports multiple languages.

    • en_US: English description
    • zh_CN: Chinese description

functions

  • name: attribute name; This field must be provided;
  • example
  • hint: hint information of the function; this field is optional;
    • en_US
    • zh_CN

Sample file

The following is a sample of metadata file.

  1. {
  2. "about": {
  3. "trial":false,
  4. "author": {
  5. "name": "",
  6. "email": "",
  7. "company": "",
  8. "website": ""
  9. },
  10. "helpUrl": {
  11. "en_US": "",
  12. "zh_CN": ""
  13. },
  14. "description": {
  15. "en_US": "",
  16. "zh_CN": ""
  17. }
  18. },
  19. "functions": [{
  20. "name": "",
  21. "example": "",
  22. "hint": {
  23. "en_US": "",
  24. "zh_CN": ""
  25. }
  26. }]
  27. }