1616from behavior import BehaviorEngine
1717from semantic import ImprovedSemanticDetector
1818from fusion import ImprovedFusionEngine
19+ from slack_notifier import SlackNotifier
1920
2021# Configuration
2122REDIS_HOST = os .getenv ("REDIS_HOST" , "localhost" )
@@ -35,6 +36,7 @@ def __init__(self):
3536 self ._semantic_engine : Optional [ImprovedSemanticDetector ] = None
3637 self ._behavior_engine : Optional [BehaviorEngine ] = None
3738 self ._fusion_engine : Optional [ImprovedFusionEngine ] = None
39+ self ._slack_notifier : Optional [SlackNotifier ] = None
3840 self ._processed_count = 0
3941 self ._alert_count = 0
4042
@@ -98,6 +100,10 @@ def _init_engines(self) -> bool:
98100 self ._fusion_engine = ImprovedFusionEngine ()
99101 print ("[ENGINE] Fusion Engine ready" )
100102
103+ print ("[ENGINE] Initializing Slack Notifier..." )
104+ self ._slack_notifier = SlackNotifier ()
105+
106+
101107 return True
102108 except Exception as e :
103109 print (f"[ENGINE] Initialization failed: { e } " )
@@ -257,6 +263,10 @@ def _handle_message(self, message: dict):
257263 print (self ._format_alert (result , log_data , processing_time_ms ))
258264 # Save alert to Redis for dashboard
259265 self ._save_alert_to_redis (result )
266+
267+ # Send Slack Alert
268+ if self ._slack_notifier :
269+ self ._slack_notifier .send_alert (result )
260270 else :
261271 self ._log_processed (result , processing_time_ms )
262272
0 commit comments