Hi,
I want to test if a table that holds data from an input source file with the automatic refresh mode “REREAD” reflects changes applied to the source file. This is what my file looks like
-----------------------------config.bro---------------------------------
module Config;
type Idx: record {
parameter: string;
};
type Val: record {
value: string;
};
export {
global table_config: table[string] of Val;
}
global config_filename = “/usr/local/bro/share/bro/site/botflex/config.txt”;
event bro_init() &priority=20
{
Input::add_table([$source=config_filename, $name=“config_stream”, $idx=Idx,
$val=Val, $destination=table_config, $mode=Input::REREAD]);
Input::remove(“config_stream”);
}
event Input::update_finished(name: string, source: string)
{
now all data is in the table
print “Updated”;
print table_config;
}
event bro_done()
{
print “Ending”;
print table_config;
}