Saltstack Official Syslog-NG Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 line
924B

  1. {%- from "syslog_ng/macro.jinja" import rule_builder -%}
  2. {%- from "syslog_ng/map.jinja" import syslog_ng with context -%}
  3. @version: {{ syslog_ng.get('version', '3.3') }}
  4. {%- for module in syslog_ng.get('module', []) %}
  5. @module {{ rule_builder(module) }}
  6. {%- endfor %}
  7. {%- for inc in syslog_ng.get('include', []) %}
  8. @include {{ rule_builder(inc) }}
  9. {%- endfor %}
  10. options {
  11. {%- for rule in syslog_ng.get('options', []) %}
  12. {{ rule_builder(rule) }};
  13. {%- endfor %}
  14. };
  15. {%- for obj in ('source', 'destination', 'filter', 'parser', 'rewrite', 'template') %}
  16. {%- for params in syslog_ng.get(obj, []) %}
  17. {% for name, rules in params.items() %}
  18. {{ obj }} {{ name }} {
  19. {%- for rule in rules %}
  20. {{ rule_builder(rule) }};
  21. {%- endfor %}
  22. };
  23. {%- endfor %}
  24. {%- endfor %}
  25. {%- endfor %}
  26. {% for loggers in syslog_ng.get('log', []) -%}
  27. log {
  28. {%- for rule in loggers %}
  29. {{ rule_builder(rule) }};
  30. {%- endfor %}
  31. };
  32. {% endfor %}