-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.zeek
41 lines (34 loc) · 1.1 KB
/
main.zeek
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
##! main.zeek
##!
##! Zeek script type/record definitions describing the information
##! that will be written to the log files.
##!
##! Author: Taegan Williams
##! Contact: [email protected]
##!
##! Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
module PROFINET_IO_CM;
export {
redef enum Log::ID += {
LOG_PROFINET
};
global log_profinet: event(rec: Profinet_Header);
## Log policies for log filtering
global log_policy_profinet: Log::PolicyHook;
}
# redefine connection record to contain one of each of the pnio_cm records
redef record connection += {
log_profinet : Profinet_Header &optional;
};
event zeek_init() &priority=5 {
Log::create_stream(LOG_PROFINET,[$columns=Profinet_Header,
$ev=log_profinet,
$path="profinet_io_cm",
$policy=log_policy_profinet]);
}
function emit_header_log(c: connection) {
if (! c?$log_profinet )
return;
Log::write(PROFINET_IO_CM::LOG_PROFINET, c$log_profinet);
delete c$log_profinet;
}