1 {%- from "influxdb/map.jinja" import relay with context -%}
3 {%- if relay.get('enabled') %}
5 {%- if relay.telemetry.get('enabled') %}
7 bind-addr = "{{ relay.telemetry.bind.get('address', '') }}:{{ relay.telemetry.bind.port }}"
10 {%- for name, listen in relay.listen.iteritems()|sort %}
12 {%- if listen.get('enabled', True) and listen.get('type', 'http') in ('http', 'udp') %}
14 {%- set listen_type = listen.get('type', 'http') %}
17 bind-addr = "{{ listen.bind.get('address', '') }}:{{ listen.bind.port }}"
18 {%- if listen_type == 'http' and listen.default_retention_policy is defined %}
19 default-retention-policy = "{{ listen.default_retention_policy }}"
21 {%- if listen_type == 'udp' and listen.precision is defined %}
22 precision = "{{ listen.precision }}"
24 {%- if listen_type == 'udp' and listen.read_buffer is defined %}
25 read-buffer = {{ listen.read_buffer|int }}
28 {%- set outputs = [] %}
29 {%- for output_name, output in listen.get('output', {}).iteritems()|sort %}
30 {%- set tmp = ['name = "{}"'.format(output_name), 'location = "{}"'.format( output.location)] %}
31 {%- if listen_type == 'http' and output.timeout is defined %}
32 {%- do tmp.append('timeout = "{}"'.format(output.timeout)) %}
34 {%- if listen_type == 'http' and output.buffer_size_mb is defined %}
35 {%- do tmp.append('buffer-size-mb = {}'.format(output.buffer_size_mb)) %}
37 {%- if listen_type == 'http' and output.max_batch_kb is defined %}
38 {%- do tmp.append('max-batch-kb = {}'.format(output.max_batch_kb)) %}
40 {%- if listen_type == 'http' and output.max_delay_interval is defined %}
41 {%- do tmp.append('max-delay-interval = "{}"'.format(output.max_delay_interval)) %}
43 {%- if listen_type == 'udp' and output.mtu is defined %}
44 {%- do tmp.append('mtu = {}'.format(output.mtu)) %}
46 {%- do outputs.append(tmp) %}
50 {%- for output in outputs %}
51 { {{ output|join(', ') }} },