-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flusher-clickhouse不刷日志 #1202
Comments
#554 |
你好,这个有没有参考的配置 |
需要自己建2个表,一个物化表,一个数据表 CREATE TABLE blade
(
log_time DateTime,
container_name String,
host_ip String,
host_name String,
content String
)
ENGINE = MergeTree PARTITION BY toYYYYMMDD(log_time)
PRIMARY KEY log_time
ORDER BY (log_time, container_name)
SETTINGS index_granularity = 8192; CREATE MATERIALIZED VIEW default.blade_view
TO default.blade
(
`log_time` String,
`container_name` String,
`host_ip` String,
`host_name` String,
`content` String
)
AS
SELECT
replaceAll(visitParamExtractRaw(_log, 'time'), '"', '') AS log_time,
visitParamExtractRaw(_log, 'container.name') AS container_name,
visitParamExtractRaw(_log, 'host.ip') AS host_ip,
visitParamExtractRaw(_log, 'host.name') AS host_name,
visitParamExtractRaw(_log, 'content') AS content
FROM
default.ilogtail_blade; |
针对单表现在能正常存储,使用匹配好像就有问题,麻烦大佬帮忙看看
|
|
请问下 这个是一定需要的吗 CREATE MATERIALIZED VIEW, 这种看起来会存储2份数据 |
https://clickhouse.com/docs/en/engines/table-engines/special/null |
null 表是临时表,不存储数据,最后物化视图的目标表进行存储 |
配置文件
在default数据库会自动生成2个表
ilogtail_blade_logs
和ilogtail_blade_logs_buffer
The text was updated successfully, but these errors were encountered: