diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-03-21 14:09:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 14:09:39 +0200 |
commit | 1964fd7c75742abb668fba6a4e06cbf5803374da (patch) | |
tree | c60042ce10cc3dc425df545424d2e14e0e02d45b /python | |
parent | cb26936dc0994f42dc457b5f7ea82b14583ab8a9 (diff) | |
parent | 9a9f6e346beb209c819d859e2c7081f145060ac1 (diff) | |
download | vyos-1x-1964fd7c75742abb668fba6a4e06cbf5803374da.tar.gz vyos-1x-1964fd7c75742abb668fba6a4e06cbf5803374da.zip |
Merge pull request #1889 from nicolas-fort/T5050-log
T5050: Firewall: Add log options
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/firewall.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py index 5be897d5f..137fd2c56 100644 --- a/python/vyos/firewall.py +++ b/python/vyos/firewall.py @@ -223,10 +223,21 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name): action = rule_conf['action'] if 'action' in rule_conf else 'accept' output.append(f'log prefix "[{fw_name[:19]}-{rule_id}-{action[:1].upper()}]"') - if 'log_level' in rule_conf: - log_level = rule_conf['log_level'] - output.append(f'level {log_level}') + if 'level' in rule_conf['log_options']: + log_level = rule_conf['log_options']['level'] + output.append(f'log level {log_level}') + if 'group' in rule_conf['log_options']: + log_group = rule_conf['log_options']['group'] + output.append(f'log group {log_group}') + + if 'queue_threshold' in rule_conf['log_options']: + queue_threshold = rule_conf['log_options']['queue_threshold'] + output.append(f'queue-threshold {queue_threshold}') + + if 'snapshot_length' in rule_conf['log_options']: + log_snaplen = rule_conf['log_options']['snapshot_length'] + output.append(f'snaplen {log_snaplen}') if 'hop_limit' in rule_conf: operators = {'eq': '==', 'gt': '>', 'lt': '<'} |