raw input reader for seth, which can simply read a file into string-events given a line separator.

This commit is contained in:
Bernhard Amann 2012-02-22 09:44:45 -08:00
parent 531189b5fd
commit 7e5f733826
11 changed files with 363 additions and 2 deletions

View 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]);
}