GH-387: update Broker topic names to use "zeek/" prefix

This commit is contained in:
Jon Siwek 2019-05-29 15:56:37 -07:00
parent c25520cf3f
commit 1ce0fcce49
35 changed files with 351 additions and 309 deletions

View file

@ -772,6 +772,15 @@ bool Manager::Subscribe(const string& topic_prefix)
{
DBG_LOG(DBG_BROKER, "Subscribing to topic prefix %s", topic_prefix.c_str());
bstate->subscriber.add_topic(topic_prefix, ! after_zeek_init);
// For backward compatibility, we also may receive messages on
// "bro/" topic prefixes in addition to "zeek/".
if ( strncmp(topic_prefix.data(), "zeek/", 5) == 0 )
{
std::string alt_topic = "bro/" + topic_prefix.substr(5);
bstate->subscriber.add_topic(std::move(alt_topic), ! after_zeek_init);
}
return true;
}