1 {%- from "influxdb/map.jinja" import relay with context -%}
3 {%- if relay.get('enabled') %}
5 {%- for name, listen in relay.listen.iteritems()|sort %}
7 {%- if listen.get('enabled', True) and listen.get('type', 'http') in ('http', 'udp') %}
9 {%- set listen_type = listen.get('type', 'http') %}
12 bind-addr = "{{ listen.bind.get('address', '0.0.0.0') }}:{{ listen.bind.port }}"
13 {%- if listen_type == 'http' and listen.default_retention_policy is defined %}
14 default-retention-policy = "{{ listen.default_retention_policy }}"
16 {%- if listen_type == 'udp' and listen.precision is defined %}
17 precision = "{{ listen.precision }}"
19 {%- if listen_type == 'udp' and listen.read_buffer is defined %}
20 read-buffer = {{ listen.read_buffer|int }}
23 {%- set outputs = [] %}
24 {%- for output_name, output in listen.get('output', {}).iteritems()|sort %}
25 {%- set tmp = ['name = "{}"'.format(output_name), 'location = "{}"'.format( output.location)] %}
26 {%- if listen_type == 'http' and output.timeout is defined %}
27 {%- do tmp.append('timeout = "{}"'.format(output.timeout)) %}
29 {%- if listen_type == 'http' and output.buffer_size_mb is defined %}
30 {%- do tmp.append('buffer-size-mb = {}'.format(output.buffer_size_mb)) %}
32 {%- if listen_type == 'http' and output.max_batch_kb is defined %}
33 {%- do tmp.append('max-batch-kb = {}'.format(output.max_batch_kb)) %}
35 {%- if listen_type == 'http' and output.max_delay_interval is defined %}
36 {%- do tmp.append('max-delay-interval = "{}"'.format(output.max_delay_interval)) %}
38 {%- if listen_type == 'udp' and output.mtu is defined %}
39 {%- do tmp.append('mtu = {}'.format(output.mtu)) %}
41 {%- do outputs.append(tmp) %}
45 {%- for output in outputs %}
46 { {{ output|join(', ') }} },