Skip to content

Commit 5edadad

Browse files
committed
add probe_src_addr to results table
1 parent babb1d0 commit 5edadad

File tree

4 files changed

+67
-65
lines changed

4 files changed

+67
-65
lines changed

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
anyhow = "1.0.95"
8-
caracat = "1.3.0"
8+
caracat = { git = "https://github.com/maxmouchet/caracat" }
99
chrono = "0.4.39"
1010
clap = { version = "4.5.20", features = ["derive"] }
1111
clap-verbosity-flag = "3.0.0"

src/producer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn format_reply(reply: &Reply) -> String {
3232
output.push(format!("{}", reply.reply_icmp_type));
3333
output.push(format!("{}", reply.reply_icmp_code));
3434
output.push(format!("{}", format_mpls_labels(&reply.reply_mpls_labels)));
35-
// TODO probe_src_addr
35+
output.push(format!("{}", reply.probe_src_addr));
3636
output.push(format!("{}", reply.probe_dst_addr));
3737
output.push(format!("{}", reply.probe_id));
3838
output.push(format!("{}", reply.probe_size));
Lines changed: 64 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,66 @@
1-
CREATE DATABASE osiris;
2-
CREATE TABLE osiris.results_broker
3-
(
4-
timestamp DateTime64,
5-
reply_src_addr IPv6,
6-
reply_dst_addr IPv6,
7-
reply_id UInt16,
8-
reply_size UInt16,
9-
reply_ttl UInt8,
10-
reply_protocol UInt8,
11-
reply_icmp_type UInt8,
12-
reply_icmp_code UInt8,
13-
reply_mpls_labels Array(Tuple(UInt32, UInt8, UInt8, UInt8)),
14-
probe_dst_addr IPv6,
15-
probe_id UInt16,
16-
probe_size UInt16,
17-
probe_protocol UInt8,
18-
quoted_ttl UInt8,
19-
probe_src_port UInt16,
20-
probe_dst_port UInt16,
21-
probe_ttl UInt8,
22-
rtt UInt16
23-
)
24-
ENGINE = Kafka()
25-
SETTINGS
26-
kafka_broker_list = '10.0.0.100:9093',
27-
kafka_topic_list = 'results',
28-
kafka_group_name = 'clickhouse-results-group',
29-
kafka_format = 'CSV';
1+
CREATE DATABASE osiris;
2+
CREATE TABLE osiris.results_broker
3+
(
4+
timestamp DateTime64,
5+
reply_src_addr IPv6,
6+
reply_dst_addr IPv6,
7+
reply_id UInt16,
8+
reply_size UInt16,
9+
reply_ttl UInt8,
10+
reply_protocol UInt8,
11+
reply_icmp_type UInt8,
12+
reply_icmp_code UInt8,
13+
reply_mpls_labels Array(Tuple(UInt32, UInt8, UInt8, UInt8)),
14+
probe_src_addr IPv6,
15+
probe_dst_addr IPv6,
16+
probe_id UInt16,
17+
probe_size UInt16,
18+
probe_protocol UInt8,
19+
quoted_ttl UInt8,
20+
probe_src_port UInt16,
21+
probe_dst_port UInt16,
22+
probe_ttl UInt8,
23+
rtt UInt16
24+
)
25+
ENGINE = Kafka()
26+
SETTINGS
27+
kafka_broker_list = '10.0.0.100:9093',
28+
kafka_topic_list = 'results',
29+
kafka_group_name = 'clickhouse-results-group',
30+
kafka_format = 'CSV';
3031

31-
CREATE TABLE osiris.results
32-
(
33-
timestamp DateTime64,
34-
reply_src_addr IPv6,
35-
reply_dst_addr IPv6,
36-
reply_id UInt16,
37-
reply_size UInt16,
38-
reply_ttl UInt8,
39-
reply_protocol UInt8,
40-
reply_icmp_type UInt8,
41-
reply_icmp_code UInt8,
42-
reply_mpls_labels Array(Tuple(UInt32, UInt8, UInt8, UInt8)),
43-
probe_dst_addr IPv6,
44-
probe_id UInt16,
45-
probe_size UInt16,
46-
probe_protocol UInt8,
47-
quoted_ttl UInt8,
48-
probe_src_port UInt16,
49-
probe_dst_port UInt16,
50-
probe_ttl UInt8,
51-
rtt UInt16
52-
)
53-
ENGINE = MergeTree()
54-
ORDER BY (
55-
probe_protocol,
56-
probe_dst_addr,
57-
probe_src_port,
58-
probe_dst_port,
59-
probe_ttl
60-
);
32+
CREATE TABLE osiris.results
33+
(
34+
timestamp DateTime64,
35+
reply_src_addr IPv6,
36+
reply_dst_addr IPv6,
37+
reply_id UInt16,
38+
reply_size UInt16,
39+
reply_ttl UInt8,
40+
reply_protocol UInt8,
41+
reply_icmp_type UInt8,
42+
reply_icmp_code UInt8,
43+
reply_mpls_labels Array(Tuple(UInt32, UInt8, UInt8, UInt8)),
44+
probe_src_addr IPv6,
45+
probe_dst_addr IPv6,
46+
probe_id UInt16,
47+
probe_size UInt16,
48+
probe_protocol UInt8,
49+
quoted_ttl UInt8,
50+
probe_src_port UInt16,
51+
probe_dst_port UInt16,
52+
probe_ttl UInt8,
53+
rtt UInt16
54+
)
55+
ENGINE = MergeTree()
56+
ORDER BY (
57+
probe_protocol,
58+
probe_src_addr,
59+
probe_dst_addr,
60+
probe_src_port,
61+
probe_dst_port,
62+
probe_ttl
63+
);
6164

62-
CREATE MATERIALIZED VIEW osiris.results_broker_mv TO osiris.results
63-
AS SELECT * FROM osiris.results_broker;
65+
CREATE MATERIALIZED VIEW osiris.results_broker_mv TO osiris.results
66+
AS SELECT * FROM osiris.results_broker;

0 commit comments

Comments
 (0)