mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

This change introduces error events for Table and Event readers. Users can now specify an event that is called when an info, warning, or error is emitted by their input reader. This can, e.g., be used to raise notices in case errors occur when reading an important input stream. Example: event error_event(desc: Input::TableDescription, msg: string, level: Reporter::Level) { ... } event bro_init() { Input::add_table([$source="a", $error_ev=error_event, ...]); } For the moment, this converts all errors in the Asciiformatter into warnings (to show that they are non-fatal) - the Reader itself also has to throw an Error to show that a fatal error occurred and processing will be abort. It might be nicer to change this and require readers to mark fatal errors as such when throwing them. Addresses BIT-1181
144 lines
2.9 KiB
Text
144 lines
2.9 KiB
Text
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
sdfkh:KH;fdkncv;ISEUp34:Fkdj;YVpIODhfDF
|
|
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
DSF"DFKJ"SDFKLh304yrsdkfj@#(*U$34jfDJup3UF
|
|
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
q3r3057fdf
|
|
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
sdfs\d
|
|
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
|
|
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
dfsdf
|
|
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
sdf
|
|
[source=../input.log, reader=Input::READER_RAW, mode=Input::STREAM, name=input, fields=<no value description>, want_record=F, ev=line
|
|
{
|
|
print outfile, A::description;
|
|
print outfile, A::tpe;
|
|
print outfile, A::s;
|
|
try = try + 1;
|
|
if (8 == try)
|
|
{
|
|
Input::remove(input);
|
|
close(outfile);
|
|
terminate();
|
|
}
|
|
|
|
}, error_ev=<uninitialized>, config={
|
|
|
|
}]
|
|
Input::EVENT_NEW
|
|
3rw43wRRERLlL#RWERERERE.
|