mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 19:48:20 +00:00
raw input reader for seth, which can simply read a file into string-events given a line separator.
This commit is contained in:
parent
531189b5fd
commit
7e5f733826
11 changed files with 363 additions and 2 deletions
35
testing/btest/scripts/base/frameworks/input/raw.bro
Normal file
35
testing/btest/scripts/base/frameworks/input/raw.bro
Normal file
|
@ -0,0 +1,35 @@
|
|||
#
|
||||
# @TEST-EXEC: bro %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
@TEST-START-FILE input.log
|
||||
sdfkh:KH;fdkncv;ISEUp34:Fkdj;YVpIODhfDF
|
||||
DSF"DFKJ"SDFKLh304yrsdkfj@#(*U$34jfDJup3UF
|
||||
q3r3057fdf
|
||||
sdfs\d
|
||||
|
||||
dfsdf
|
||||
sdf
|
||||
3rw43wRRERLlL#RWERERERE.
|
||||
@TEST-END-FILE
|
||||
|
||||
|
||||
module A;
|
||||
|
||||
export {
|
||||
redef enum Input::ID += { INPUT };
|
||||
}
|
||||
|
||||
type Val: record {
|
||||
s: string;
|
||||
};
|
||||
|
||||
event line(tpe: Input::Event, s: string) {
|
||||
print s;
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
Input::create_stream(A::INPUT, [$source="input.log", $reader=Input::READER_RAW, $mode=Input::STREAM]);
|
||||
Input::add_eventfilter(A::INPUT, [$name="input", $fields=Val, $ev=line]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue