Skip to main content

Using Databend as a Sink for Vector

What is Vector?

  • A lightweight, ultra-fast tool for building observability pipelines.
  • Allows you to Gather, Transform, and Route all log and metric data with one simple tool.
  • Made up of three components (sources, transforms, sinks) of two types (logs, metrics).

Databend supports ClickHouse REST API, so it's easy to integration with Vector to stream, aggregate, and gain insights.

Create a Databend User

Connect to Databend server with MySQL client:

mysql -h127.0.0.1 -uroot -P3307 

Create a user:

CREATE USER user1 IDENTIFIED BY 'abc123';

Create a Database:

CREATE DATABASE nginx;

Grant insert privileges for the user:

GRANT INSERT ON nginx.* TO user1;

See also How To Create User.

Configure Vector

To use Databend with Vector you will need to configure for Clickhouse Sink:

[sinks.databend_sink]
type = "clickhouse"
inputs = [ "my-source-or-transform-id" ] # input source
database = "mydatabase" #Your database
table = "mytable" #Your table.
endpoint = "http://localhost:8124/" #Databend ClickHouse REST API: http://{clickhouse_http_handler_host}:{clickhouse_http_handler_port}/
compression = "gzip"
[sinks.databend_sink.auth]
strategy = "basic"
user = "user1" #Databend username
password = "abc123" #Databend password

To learn more, please refer to the following documents.

Tutorial

How to Analyze Nginx Access Logs With Databend