diff --git a/docs/en_US/guide/sinks/plugin/influx.md b/docs/en_US/guide/sinks/plugin/influx.md
index d9435a548a..37ab8137c0 100644
--- a/docs/en_US/guide/sinks/plugin/influx.md
+++ b/docs/en_US/guide/sinks/plugin/influx.md
@@ -2,43 +2,39 @@
The sink will publish the result into a InfluxDB.
-## Compile & deploy plugin
-
-Please make following update before compile the plugin,
-
-- Add Influxdb library reference in `go.mod`.
-- Remove the first line `// +build plugins` of file `plugins/sinks/influx.go`.
-
-```shell
-# cd $eKuiper_src
-# go build -trimpath --buildmode=plugin -o plugins/sinks/Influx.so extensions/sinks/influx/influx.go
-# zip influx.zip plugins/sinks/Influx.so
-# cp influx.zip /root/tomcat_path/webapps/ROOT/
-# bin/kuiper create plugin sink influx -f /tmp/influxPlugin.txt
-# bin/kuiper create rule influx -f /tmp/influxRule.txt
-```
-
-Restart the eKuiper server to activate the plugin.
-
## Properties
-| Property name | Optional | Description |
-|---------------|----------|---------------------------------------------------|
-| addr | true | The addr of the InfluxDB |
-| measurement | true | The measurement of the InfluxDb (like table name) |
-| username | false | The InfluxDB login username |
-| password | false | The InfluxDB login password |
-| databasename | true | The database of the InfluxDB |
-| tagkey | true | The tag key of the InfluxDB |
-| tagvalue | true | The tag value of the InfluxDB |
-
-Other common sink properties are supported. Please refer to the [sink common properties](../overview.md#common-properties) for more information.
+Connection properties:
+
+| Property name | Optional | Description |
+|----------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| addr | true | The addr of the InfluxDB |
+| username | false | The InfluxDB login username |
+| password | false | The InfluxDB login password |
+| database | true | The database of the InfluxDB |
+| certificationPath | true | The certification path. It can be an absolute path, or a relative path. If it is an relative path, then the base path is where you executing the `kuiperd` command. For example, if you run `bin/kuiperd` from `/var/kuiper`, then the base path is `/var/kuiper`; If you run `./kuiperd` from `/var/kuiper/bin`, then the base path is `/var/kuiper/bin`. |
+| privateKeyPath | true | The private key path. It can be either absolute path, or relative path, which is similar to use of certificationPath. |
+| rootCaPath | true | The location of root ca path. It can be an absolute path, or a relative path, which is similar to use of certificationPath. |
+| tlsMinVersion | true | Specifies the minimum version of the TLS protocol that will be negotiated with the client. Accept values are `tls1.0`, `tls1.1`, `tls1.2` and `tls1.3`. Default: `tls1.2`. |
+| renegotiationSupport | true | Determines how and when the client handles server-initiated renegotiation requests. Support `never`, `once` or `freely` options. Default: `never`. |
+| insecureSkipVerify | true | If InsecureSkipVerify is `true`, TLS accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks. The default value is `false`. The configuration item can only be used with TLS connections. |
+
+Write options:
+
+| Property name | Optional | Description |
+|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| measurement | false | The measurement of the InfluxDb (like table name) |
+| tags | true | The tags to write, the format is like {"tag1":"value1"}. The value can be dataTemplate format, like {"tag1":"{{.temperature}}"} |
+| fields | true | The fields to write, the format is like ["field1", "field2"]. If fields is not set, all fields selected in the SQL will all written to InfluxDB. |
+| precision | true | The precision of the timestamp. Support `ns`, `us`, `ms`, `s`. Default: `ms`. |
+| tsFieldName | true | The field name of the timestamp. If set, the written timestamp will use the value of the field. For example, if the data has {"ts": 1888888888} and the tsFieldName is set to ts, then the value 1888888888 will be used when written to InfluxDB. Make sure the value is formatted according to the precision. If not set, the current timestamp will be used. |
+
+Other common sink properties including batch settings are supported. Please refer to
+the [sink common properties](../overview.md#common-properties) for more information.
## Sample usage
-Below is a sample for selecting temperature great than 50 degree, and some profiles only for your reference.
-
-### /tmp/influxRule.txt
+Below is a sample for selecting temperature greater than 50 degree and write into influxDB.
```json
{
@@ -52,37 +48,11 @@ Below is a sample for selecting temperature great than 50 degree, and some profi
"username": "",
"password": "",
"measurement": "test",
- "databasename": "databasename",
- "tagkey": "tagkey",
- "tagvalue": "tagvalue",
+ "database": "databasename",
+ "tags": "{\"tag1\":\"value1\"}",
"fields": ["humidity", "temperature", "pressure"]
}
}
]
}
```
-
-### /tmp/influxPlugin.txt
-
-```json
-{
- "file":"http://localhost:8080/influx.zip"
- }
-```
-
-### plugins/go.mod
-
-```go
-module plugins
-
-go 1.14
-
-require (
- github.com/lf-edge/ekuiper v0.0.0-20200323140757-60d00241372b
- github.com/influxdata/influxdb-client-go v1.2.0
- github.com/influxdata/influxdb1-client v0.0.0-20200515024757-02f0bf5dbca3 // indirect
-)
-
-replace github.com/lf-edge/ekuiper => /root/goProject/kuiper
-
-```
diff --git a/docs/en_US/guide/sinks/plugin/influx2.md b/docs/en_US/guide/sinks/plugin/influx2.md
index ebcd7f8022..12fd77cff0 100644
--- a/docs/en_US/guide/sinks/plugin/influx2.md
+++ b/docs/en_US/guide/sinks/plugin/influx2.md
@@ -2,61 +2,6 @@
The sink will publish the result into a InfluxDB `V2.X` .
-## Compile & deploy plugin
-
-Please make following update before compile the plugin,
-
-- Add Influxdb library reference in `go.mod`.
-- Remove the first line `// +build plugins` of file `plugins/sinks/influx.go`.
-
-### build in shell
-
-```shell
-# cd $eKuiper_src
-# go build -trimpath --buildmode=plugin -o plugins/sinks/influx2.so extensions/sinks/influx/influx2.go
-# zip influx2.zip plugins/sinks/influx2.so
-# cp influx.zip /root/tomcat_path/webapps/ROOT/
-# bin/kuiper create plugin sink influx2 -f /tmp/influxPlugin.txt
-# bin/kuiper create rule influx2 -f /tmp/influxRule.txt
-```
-
-### build with image
-
-```shell
-docker build -t demo/plugins:v1 -f build/plugins/Dockerfile .
-docker run demo/plugins:v1
-docker cp 90eae15a7245:/workspace/_plugins/debian/sinks /tmp
-```
-
-Dockerfile like this:
-
-```dockerfile
-## plase check go version that kuiper used
-ARG GO_VERSION=1.18.5
-FROM ghcr.io/lf-edge/ekuiper/base:$GO_VERSION-debian AS builder
-WORKDIR /workspace
-ADD . /workspace/
-RUN go env -w GOPROXY=https://goproxy.cn,direct
-RUN make plugins_c
-CMD ["sleep","3600"]
-```
-
-add this in Makefile:
-
-```dockerfile
-PLUGINS_CUSTOM := sinks/influx2
-
-.PHONY: plugins_c $(PLUGINS_CUSTOM)
-plugins_c: $(PLUGINS_CUSTOM)
-
-$(PLUGINS_CUSTOM): PLUGIN_TYPE = $(word 1, $(subst /, , $@))
-$(PLUGINS_CUSTOM): PLUGIN_NAME = $(word 2, $(subst /, , $@))
-$(PLUGINS_CUSTOM):
- @$(CURDIR)/build-plugins.sh $(PLUGIN_TYPE) $(PLUGIN_NAME)
-```
-
-Restart the eKuiper server to activate the plugin.
-
## Properties
Connection properties:
@@ -79,7 +24,7 @@ Write options:
| Property name | Optional | Description |
|-----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| measurement | false | The measurement of the InfluxDb (like table name) |
-| tags | true | The tags to write, the format is like {"tag1":"value1"}. The value can be dataTemplate format, like {"tag1":"{{.temperature}}"} |
+| tags | true | The tags to write, the format is like {"tag1":"value1"}. The value can be dataTemplate format, like {"tag1":"{{.temperature}}"} |
| fields | true | The fields to write, the format is like ["field1", "field2"]. If fields is not set, all fields selected in the SQL will all written to InfluxDB. |
| precision | true | The precision of the timestamp. Support `ns`, `us`, `ms`, `s`. Default: `ms`. |
| tsFieldName | true | The field name of the timestamp. If set, the written timestamp will use the value of the field. For example, if the data has {"ts": 1888888888} and the tsFieldName is set to ts, then the value 1888888888 will be used when written to InfluxDB. Make sure the value is formatted according to the precision. If not set, the current timestamp will be used. |
@@ -90,9 +35,7 @@ the [sink common properties](../overview.md#common-properties) for more informat
## Sample usage
-Below is a sample for selecting temperature greater than 50 degree, and some profiles only for your reference.
-
-### /tmp/influxRule.txt
+Below is a sample for selecting temperature greater than 50 degree and write into influxDB.
```json
{
@@ -114,28 +57,3 @@ Below is a sample for selecting temperature greater than 50 degree, and some pro
]
}
```
-
-### /tmp/influxPlugin.txt
-
-```json
-{
- "file":"http://localhost:8080/influx2.zip"
- }
-```
-
-### plugins/go.mod
-
-```go
-module plugins
-
-go 1.18
-
-require (
- github.com/lf-edge/ekuiper v0.0.0-20220727015637-7d6f5c447110
- github.com/influxdata/influxdb-client-go/v2 v2.10.0
- github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
-)
-
-replace github.com/lf-edge/ekuiper => /root/goProject/kuiper
-
-```
diff --git a/docs/zh_CN/guide/sinks/plugin/influx.md b/docs/zh_CN/guide/sinks/plugin/influx.md
index edff1eccf5..cfcf0da4e9 100644
--- a/docs/zh_CN/guide/sinks/plugin/influx.md
+++ b/docs/zh_CN/guide/sinks/plugin/influx.md
@@ -2,41 +2,37 @@
该插件将分析结果发送到 InfluxDB 中。
-## 编译部署插件
-
-在编译之前,请对源代码做如下更改:
+## 属性
-- 在 `go.mod` 文件中增加对 InfluxDB 库文件的引用
-- 把文件 `plugins/sinks/influxdb.go` 中的第一行 `// +build plugins` 删除
+连接相关的属性:
-```shell
-# cd $eKuiper_src
-# go build -trimpath --buildmode=plugin -o plugins/sinks/InfluxDB.so extensions/sinks/influxdb/influxdb.go
-# zip influx.zip plugins/sinks/InfluxDB.so
-# cp influx.zip /root/tomcat_path/webapps/ROOT/
-# bin/kuiper create plugin sink influx -f /tmp/influxPlugin.txt
-# bin/kuiper create rule influx -f /tmp/influxRule.txt
-```
+| 属性名称 | 会否可选 | 说明 |
+|----------------------|------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| addr | 是 | InfluxDB 的地址 |
+| username | 否 | InfluxDB 登陆用户名 |
+| password | 否 | InfluxDB 登陆密码 |
+| database | 是 | InfluxDB 数据库名称 |
+| certificationPath | 是 | 证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行 `kuiperd` 命令的路径。比如,如果你在 `/var/kuiper` 中运行 `bin/kuiperd` ,那么父目录为 `/var/kuiper`; 如果运行从 `/var/kuiper/bin` 中运行`./kuiperd`,那么父目录为 `/var/kuiper/bin`。 |
+| privateKeyPath | 是 | 私钥路径。可以为绝对路径,也可以为相对路径,相对路径的用法与 `certificationPath` 类似。 |
+| rootCaPath | 是 | 根证书路径,用以验证服务器证书。可以为绝对路径,也可以为相对路径,相对路径的用法与 `certificationPath` 类似。 |
+| renegotiationSupport | true | Determines how and when the client handles server-initiated renegotiation requests. Support `never`, `once` or `freely` options. Default: `never`. |
+| insecureSkipVerify | 是 | 如果 InsecureSkipVerify 设置为 `true`, TLS接受服务器提供的任何证书以及该证书中的任何主机名。 在这种模式下,TLS容易受到中间人攻击。默认值为 `false`。配置项只能用于TLS连接。 |
-重新启动 eKuiper 服务器以激活插件。
-
-## 属性
+写入相关属性:
-| 属性名称 | 会否可选 | 说明 |
-|--------------|------|------------------|
-| addr | 是 | InfluxDB 的地址 |
-| measurement | 是 | InfluxDb 的测量(如表名) |
-| username | 否 | InfluxDB 登陆用户名 |
-| password | 否 | InfluxDB 登陆密码 |
-| databasename | 是 | InfluxDB 数据库名称 |
-| tagkey | 是 | InfluxDB 的标签键 |
-| tagvalue | 是 | InfluxDB 的标签值 |
+| 属性名称 | 是否可选 | 说明 |
+|-------------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| measurement | 是 | InfluxDB 的测量(如表名) |
+| tags | true | 标签键值对,其格式为 {"tag1":"value1"}。其中,值可为数据模板格式,例如 {"tag1":"{{.temperature}}"} |
+| fields | true | 需要写入的字段列表,格式为 ["field1", "field2"] 。如果该属性未设置,则所有 SQL 中选出的字段都会写入 InfluxDB 。 |
+| precision | true | 时间戳精度,若采用自定义时间,需要保证时间精度与此设置相同。 可设置为 `ns`, `us`, `ms`, `s`。默认为 `ms`。 |
+| tsFieldName | true | 时间戳字段名。若有设置,写入时的时间戳以该字段的值为准。例如,假设数据为 {"ts": 1888888888} 且 tsFieldName 属性设置为 ts,则 1888888888 将作为此条数据写入作为的时间戳。此时,需要确保时间戳的值的精度与 precision 的配置相同。 如果该属性未设置,则写入时采用当时的时间戳。 |
-其他通用的 sink 属性也支持,请参阅[公共属性](../overview.md#公共属性)。
+其他通用的 sink 属性也支持,包括批量设置等,请参阅[公共属性](../overview.md#公共属性)。
## 示例用法
-下面是选择温度大于 50 度的样本规则,和一些配置文件仅供参考。
+下面是选择温度大于 50 度并写入 influxDB 的示例规则。
### /tmp/influxRule.txt
@@ -52,37 +48,11 @@
"username": "",
"password": "",
"measurement": "test",
- "databasename": "databasename",
- "tagkey": "tagkey",
- "tagvalue": "tagvalue",
+ "database": "databasename",
+ "tags": "{\"tag1\":\"value1\"}",
"fields": ["humidity", "temperature", "pressure"]
}
}
]
}
```
-
-### /tmp/influxPlugin.txt
-
-```json
-{
- "file":"http://localhost:8080/influx.zip"
-}
-```
-
-### plugins/go.mod
-
-```go
-module plugins
-
-go 1.14
-
-require (
- github.com/lf-edge/ekuiper v0.0.0-20200323140757-60d00241372b
- github.com/influxdata/influxdb-client-go v1.2.0
- github.com/influxdata/influxdb1-client v0.0.0-20200515024757-02f0bf5dbca3 // indirect
-)
-
-replace github.com/lf-edge/ekuiper => /root/goProject/ekuiper
-
-```
diff --git a/docs/zh_CN/guide/sinks/plugin/influx2.md b/docs/zh_CN/guide/sinks/plugin/influx2.md
index e8679a2420..77c1966649 100644
--- a/docs/zh_CN/guide/sinks/plugin/influx2.md
+++ b/docs/zh_CN/guide/sinks/plugin/influx2.md
@@ -2,60 +2,6 @@
该插件将分析结果发送到 InfluxDB V2.X 中。
-## 编译部署插件
-
-在编译之前,请对源代码做如下更改:
-
-- 在 `go.mod` 文件中增加对 InfluxDB 库文件的引用
-
-### 本地构建
-
-```shell
-# cd $eKuiper_src
-# go build -trimpath --buildmode=plugin -o plugins/sinks/influx2.so extensions/sinks/influx/influx2.go
-# zip influx2.zip plugins/sinks/influx2.so
-# cp influx.zip /root/tomcat_path/webapps/ROOT/
-# bin/kuiper create plugin sink influx2 -f /tmp/influxPlugin.txt
-# bin/kuiper create rule influx2 -f /tmp/influxRule.txt
-```
-
-### 镜像构建
-
-```shell
-docker build -t demo/plugins:v1 -f build/plugins/Dockerfile .
-docker run demo/plugins:v1
-docker cp 90eae15a7245:/workspace/_plugins/debian/sinks /tmp
-```
-
-Dockerfile 如下所示:
-
-```dockerfile
-## plase check go version that kuiper used
-ARG GO_VERSION=1.18.5
-FROM ghcr.io/lf-edge/ekuiper/base:$GO_VERSION-debian AS builder
-WORKDIR /workspace
-ADD . /workspace/
-RUN go env -w GOPROXY=https://goproxy.cn,direct
-RUN make plugins_c
-CMD ["sleep","3600"]
-```
-
-在Makefile中添加:
-
-```dockerfile
-PLUGINS_CUSTOM := sinks/influx2
-
-.PHONY: plugins_c $(PLUGINS_CUSTOM)
-plugins_c: $(PLUGINS_CUSTOM)
-
-$(PLUGINS_CUSTOM): PLUGIN_TYPE = $(word 1, $(subst /, , $@))
-$(PLUGINS_CUSTOM): PLUGIN_NAME = $(word 2, $(subst /, , $@))
-$(PLUGINS_CUSTOM):
- @$(CURDIR)/build-plugins.sh $(PLUGIN_TYPE) $(PLUGIN_NAME)
-```
-
-重新启动 eKuiper 服务器以激活插件。
-
## 属性
连接相关的属性:
@@ -77,7 +23,7 @@ $(PLUGINS_CUSTOM):
| 属性名称 | 是否可选 | 说明 |
|-----------------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| measurement | 是 | InfluxDB 的测量(如表名) |
-| tags | true | 标签键值对,其格式为 {"tag1":"value1"}。其中,值可为数据模板格式,例如 {"tag1":"{{.temperature}}"} |
+| tags | true | 标签键值对,其格式为 {"tag1":"value1"}。其中,值可为数据模板格式,例如 {"tag1":"{{.temperature}}"} |
| fields | true | 需要写入的字段列表,格式为 ["field1", "field2"] 。如果该属性未设置,则所有 SQL 中选出的字段都会写入 InfluxDB 。 |
| precision | true | 时间戳精度,若采用自定义时间,需要保证时间精度与此设置相同。 可设置为 `ns`, `us`, `ms`, `s`。默认为 `ms`。 |
| tsFieldName | true | 时间戳字段名。若有设置,写入时的时间戳以该字段的值为准。例如,假设数据为 {"ts": 1888888888} 且 tsFieldName 属性设置为 ts,则 1888888888 将作为此条数据写入作为的时间戳。此时,需要确保时间戳的值的精度与 precision 的配置相同。 如果该属性未设置,则写入时采用当时的时间戳。 |
@@ -87,9 +33,7 @@ $(PLUGINS_CUSTOM):
## 示例用法
-下面是选择温度大于50度的样本规则,和一些配置文件仅供参考。
-
-### /tmp/influxRule.txt
+下面是选择温度大于 50 度并写入 influxDB 的示例规则。
```json
{
@@ -111,28 +55,3 @@ $(PLUGINS_CUSTOM):
]
}
```
-
-### /tmp/influxPlugin.txt
-
-```json
-{
- "file":"http://localhost:8080/influx2.zip"
-}
-```
-
-### plugins/go.mod
-
-```go
-module plugins
-
-go 1.18
-
-require (
- github.com/lf-edge/ekuiper v0.0.0-20220727015637-7d6f5c447110
- github.com/influxdata/influxdb-client-go/v2 v2.10.0
- github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
-)
-
-replace github.com/lf-edge/ekuiper => /root/goProject/ekuiper
-
-```