1 Star 0 Fork 0

lonesoul/filebeat-output-databend

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
databend.go 1000 Bytes
一键复制 编辑 原始数据 按行查看 历史
lonesoul 提交于 2年前 . feat: init
package filebeat_output_databend
import (
"errors"
"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/outputs"
)
var logger = logp.NewLogger("Databend")
func init() {
outputs.RegisterType("databend", makeDatabend)
}
func makeDatabend(
_ outputs.IndexManager,
beat beat.Info,
observer outputs.Observer,
cfg *common.Config,
) (outputs.Group, error) {
config := defaultConfig
if err := cfg.Unpack(&config); err != nil {
return outputs.Fail(err)
}
if len(config.Table) == 0 {
return outputs.Fail(errors.New("Databend: the table name must be set"))
}
if len(config.Columns) == 0 {
return outputs.Fail(errors.New("Databend: the table columns must be set"))
}
client := newClient(observer, config.Url, config.Table, config.Columns, config.RetryInterval, config.SkipUnexpectedTypeRow)
return outputs.Success(config.BulkMaxSize, config.MaxRetries, client)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/shengyuan/filebeat-output-databend.git
git@gitee.com:shengyuan/filebeat-output-databend.git
shengyuan
filebeat-output-databend
filebeat-output-databend
v0.1.2

搜索帮助