diff --git a/lib/core/common.py b/lib/core/common.py index aa81d730d..5f3528334 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -696,43 +696,43 @@ def singleTimeLogMessage(message, level=logging.INFO, flag=None): def setCurrentMessage(message): if "[CRITICAL]" in message: - conf.currentMessage = "CRITICAL" + kb.currentMessage = "CRITICAL" elif "[ERROR]" in message: - conf.currentMessage = "ERROR" + kb.currentMessage = "ERROR" elif "[WARNING]" in message: - conf.currentMessage = "WARNING" + kb.currentMessage = "WARNING" elif "[INFO]" in message: - conf.currentMessage = "INFO" + kb.currentMessage = "INFO" elif "[DEBUG]" in message: - conf.currentMessage = "DEBUG" + kb.currentMessage = "DEBUG" elif "[PAYLOAD]" in message: - conf.currentMessage = "PAYLOAD" + kb.currentMessage = "PAYLOAD" elif "[TRAFFIC OUT]" in message: - conf.currentMessage = "TRAFFIC OUT" + kb.currentMessage = "TRAFFIC OUT" elif "[TRAFFIC IN]" in message: - conf.currentMessage = "TRAFFIC IN" + kb.currentMessage = "TRAFFIC IN" def setColour(message): setCurrentMessage(message) - if not hasattr(conf, "currentMessage"): + if not hasattr(kb, "currentMessage"): return message - if conf.currentMessage == "CRITICAL": + if kb.currentMessage == "CRITICAL": return colored(message, 'white', on_color='on_red', attrs=['bold']) - elif conf.currentMessage == "ERROR": + elif kb.currentMessage == "ERROR": return colored(message, 'red', attrs=['bold']) - elif conf.currentMessage == "WARNING": + elif kb.currentMessage == "WARNING": return colored(message, 'yellow') - elif conf.currentMessage == "INFO": + elif kb.currentMessage == "INFO": return colored(message, 'green') - elif conf.currentMessage == "DEBUG": + elif kb.currentMessage == "DEBUG": return colored(message, 'blue') - elif conf.currentMessage == "PAYLOAD": + elif kb.currentMessage == "PAYLOAD": return colored(message, 'magenta') - elif conf.currentMessage == "TRAFFIC OUT": + elif kb.currentMessage == "TRAFFIC OUT": return colored(message, 'cyan') - elif conf.currentMessage == "TRAFFIC IN": + elif kb.currentMessage == "TRAFFIC IN": return colored(message, 'grey') else: return message diff --git a/lib/core/option.py b/lib/core/option.py index 033b8a94b..431139e16 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1380,7 +1380,6 @@ def __setConfAttributes(): conf.authPassword = None conf.boundaries = [] conf.cj = None - conf.currentMessage = None conf.dbmsConnector = None conf.dbmsHandler = None conf.dnsServer = None @@ -1437,6 +1436,7 @@ def __setKnowledgeBaseAttributes(flushAll=True): kb.commonOutputs = None kb.counters = {} + kb.currentMessage = None kb.data = AttribDict() kb.dataOutputFlag = False