mirror of
https://github.com/20kaushik02/real-time-traffic-analysis-clickhouse.git
synced 2026-01-26 00:04:06 +00:00
dict on all nodes
This commit is contained in:
23
clickhouse/node-entrypoints/main/05_kafka_table_ingest.sql
Normal file
23
clickhouse/node-entrypoints/main/05_kafka_table_ingest.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
CREATE TABLE traffic_records_kafka_queue (
|
||||
time Float64,
|
||||
l4_proto String,
|
||||
src_addr String,
|
||||
dst_addr String,
|
||||
src_port UInt16,
|
||||
dst_port UInt16,
|
||||
pkt_len UInt32
|
||||
) ENGINE = Kafka() SETTINGS kafka_broker_list = 'kafka:9092',
|
||||
kafka_topic_list = 'traffic_records_stream',
|
||||
kafka_group_name = 'clickhouse_consumer',
|
||||
kafka_format = 'JSONEachRow',
|
||||
kafka_num_consumers = 1;
|
||||
|
||||
CREATE MATERIALIZED VIEW traffic_records_kafka_view TO traffic_records_all AS
|
||||
SELECT time AS time_stamp,
|
||||
l4_proto AS l4_protocol,
|
||||
src_addr AS src_ip,
|
||||
dst_addr AS dst_ip,
|
||||
src_port,
|
||||
dst_port,
|
||||
pkt_len
|
||||
FROM traffic_records_kafka_queue;
|
||||
Reference in New Issue
Block a user