Blame view
MLTD/src/ReportSyslog.py
603 Bytes
2e20dacc7 MLTD implementati... |
1 |
import logging.handlers |
75a30f1df MLTD taking the s... |
2 |
def report(asset_id, risk, timeframe, source_ip, target_ip): |
2e20dacc7 MLTD implementati... |
3 4 5 6 7 8 9 10 11 |
my_logger = logging.getLogger('MyLogger') my_logger.setLevel(logging.DEBUG) # handler = logging.FileHandler('mltd.log') handler = logging.handlers.SysLogHandler(address='/dev/log') handler.ident = 'KEA-MLTD' formatter = logging.Formatter(' %(message)s') handler.setFormatter(formatter) my_logger.addHandler(handler) |
a063d21c7 Adding incident m... |
12 |
my_logger.critical(f'source_ip: {source_ip} target_ip: {target_ip} asset: {asset_id} risk: {risk} incident: A possible risk is predicted timeframe: {timeframe}') |
2e20dacc7 MLTD implementati... |
13 |