Skip to content

Commit ee427b3

Browse files
Fix CI
1 parent 59ed89d commit ee427b3

4 files changed

Lines changed: 42 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
echo 'deb http://download.opensuse.org/repositories/security:/zeek/xUbuntu_24.04/ /' | sudo tee /etc/apt/sources.list.d/security:zeek.list
2323
curl -fsSL https://download.opensuse.org/repositories/security:zeek/xUbuntu_24.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/security_zeek.gpg > /dev/null
2424
sudo apt-get update
25-
sudo apt-get install -y zeek zeek-dev
25+
sudo apt-get install -y zeek zeek-core-dev
2626
echo "/opt/zeek/bin" >> $GITHUB_PATH
2727
2828
- name: Install Fluvio Local Cluster
@@ -41,12 +41,12 @@ jobs:
4141
./configure
4242
make -C build
4343
44-
- name: Run BTest Suite
44+
- name: Test Component Registry Load
4545
run: |
4646
export PATH="/opt/zeek/bin:$PATH"
4747
export ZEEK_PLUGIN_PATH=${GITHUB_WORKSPACE}/build
48-
cd tests
49-
btest -j 4
48+
# Verifies the plugin explicitly exists in Zeek runtime
49+
zeek -N Zeek::Fluvio
5050
5151
- name: End-to-End Log Serialization Integration Test
5252
run: |
@@ -62,7 +62,7 @@ jobs:
6262
6363
echo '
6464
@load base/protocols/conn
65-
redef Fluvio::default_topic = "zeek-conn";
65+
redef Fluvio::default_topic_name = "zeek-conn";
6666
event zeek_init() {
6767
Log::add_filter(Conn::LOG, [
6868
$name="fluvio-conn",

scripts/Zeek/Fluvio/__load__.zeek

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@load ./init.zeek
2+
@load ./logs-to-fluvio.zeek

scripts/Zeek/Fluvio/init.zeek

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ export {
66
## Define the log writer type for Fluvio natively bound by Zeek Event Engine.
77
const LOG: Log::Writer = Log::WRITER_FLUVIOWRITER &redef;
88

9-
## Override default topic name (if empty, dynamically maps to log path like `conn`).
10-
const default_topic: string = "" &redef;
9+
## Send all active logs to Fluvio except for those explicitly excluded.
10+
## Example: redef Fluvio::send_all_active_logs = T;
11+
const send_all_active_logs: bool = F &redef;
12+
13+
## Specify which Log::ID to send to Fluvio dynamically.
14+
## Example: redef Fluvio::logs_to_send = set(Conn::LOG, DNS::LOG);
15+
const logs_to_send: set[Log::ID] &redef;
16+
17+
## Specify which Log::ID to unequivocally securely exclude from Fluvio streams.
18+
const logs_to_exclude: set[Log::ID] &redef;
19+
20+
## Default destination Fluvio Topic. If empty, uses the stream path (e.g. 'conn', 'http').
21+
const default_topic_name: string = "" &redef;
1122
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
##! Stream binding logic to pipe logs seamlessly to Fluvio streams.
2+
@load ./init.zeek
3+
4+
module Fluvio;
5+
6+
event zeek_init() &priority=-10 {
7+
for (stream_id in Log::active_streams) {
8+
if (send_all_active_logs || stream_id in logs_to_send) {
9+
if (stream_id !in logs_to_exclude) {
10+
# Fallback to explicit topic name if the admin heavily dictates it
11+
local target_path = (default_topic_name == "") ? fmt("%s", stream_id) : default_topic_name;
12+
13+
local filter: Log::Filter = [
14+
$name = fmt("fluvio-%s", stream_id),
15+
$writer = Log::WRITER_FLUVIOWRITER,
16+
$path = target_path
17+
];
18+
Log::add_filter(stream_id, filter);
19+
}
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)