3 Star 3 Fork 6

superqy/filebeat-output-clickhouse

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
clickhouse.go 1007 Bytes
一键复制 编辑 原始数据 按行查看 历史
qinyang 提交于 2021-09-30 11:20 +08:00 . update
package clickhouse_20200328
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("ClickHouse")
func init() {
outputs.RegisterType("clickHouse", makeClickHouse)
}
func makeClickHouse(
_ 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("ClickHouse: the table name must be set"))
}
if len(config.Columns) == 0 {
return outputs.Fail(errors.New("ClickHouse: 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 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/superqy/filebeat-output-clickhouse.git
git@gitee.com:superqy/filebeat-output-clickhouse.git
superqy
filebeat-output-clickhouse
filebeat-output-clickhouse
f642fbdd9dab

搜索帮助