Jeltz
ba8b4e8c29
Some checks failed
continuous-integration/drone/push Build is failing
A call to sendLogsToRemote for logs received through RELP/UDP has been added (to send them to Logstash/Redis/…), so common.conf's prefix must be lower than collector.conf's. Note: future "third-party" config files will also call sendLogsToRemote and thus will also have to use a prefix higher than 10.
55 lines
1.2 KiB
Django/Jinja
55 lines
1.2 KiB
Django/Jinja
{{ ansible_managed | comment }}
|
|
|
|
module(load="mmrm1stspace")
|
|
|
|
{%
|
|
set input_modules = {
|
|
"relp": "imrelp",
|
|
"udp": "imudp",
|
|
}
|
|
%}
|
|
|
|
{%
|
|
for module in rsyslog_inputs
|
|
| map(attribute="proto")
|
|
| map("extract", input_modules)
|
|
| list
|
|
| unique
|
|
%}
|
|
module(load="{{ module }}")
|
|
{% endfor %}
|
|
|
|
template(name="incomingFilename" type="list") {
|
|
constant(value="{{ rsyslog_collector_base_dir }}/")
|
|
property(name="fromhost-ip")
|
|
constant(value="/")
|
|
property(name="timegenerated" dateFormat="year")
|
|
constant(value="-")
|
|
property(name="timegenerated" dateFormat="month")
|
|
constant(value="-")
|
|
property(name="timegenerated" dateFormat="day")
|
|
constant(value=".log")
|
|
}
|
|
|
|
ruleset(name="handleIncomingLogs") {
|
|
action(type="mmrm1stspace")
|
|
action(
|
|
type="omfile"
|
|
dynaFile="incomingFilename"
|
|
template="RSYSLOG_FileFormat"
|
|
)
|
|
}
|
|
|
|
# TODO: add protocol-specific options (eg. TLS)
|
|
{% for input in rsyslog_inputs %}
|
|
input(
|
|
type="{{ input_modules[input.proto] }}"
|
|
{% if "address" in input %}
|
|
address="{{ input.address }}"
|
|
{% endif %}
|
|
port="{{ input.port }}"
|
|
ruleset="handleIncomingLogs"
|
|
|
|
call sendLogsToRemote
|
|
)
|
|
{% endfor %}
|