diff --git a/modules/grpc/clickhouse/clickhouse-dest.cpp b/modules/grpc/clickhouse/clickhouse-dest.cpp index 04ba4d560..2e26a5c26 100644 --- a/modules/grpc/clickhouse/clickhouse-dest.cpp +++ b/modules/grpc/clickhouse/clickhouse-dest.cpp @@ -52,6 +52,8 @@ DestDriver::init() return false; } + this->query = "INSERT INTO " + this->database + "." + this->table + " FORMAT Protobuf"; + if (!this->schema.init()) return false; diff --git a/modules/grpc/clickhouse/clickhouse-dest.hpp b/modules/grpc/clickhouse/clickhouse-dest.hpp index b787b9891..0dca3167f 100644 --- a/modules/grpc/clickhouse/clickhouse-dest.hpp +++ b/modules/grpc/clickhouse/clickhouse-dest.hpp @@ -82,6 +82,11 @@ class DestDriver final : public syslogng::grpc::DestDriver return this->password; } + const std::string &get_query() + { + return this->query; + } + Schema *get_schema() { return &this->schema; @@ -98,6 +103,7 @@ class DestDriver final : public syslogng::grpc::DestDriver std::string table; std::string user; std::string password; + std::string query; Schema schema; };