{%- if grains.role in ['so-heavynode', 'so-receiver'] %}
  {%- set HOST = GLOBALS.hostname %}
{%- else %}
  {%- set HOST = GLOBALS.manager %}
{%- endif %}
{%- set REDIS_PASS = salt['pillar.get']('redis:config:requirepass') %}

output {
	redis {
		host => '{{ HOST }}'
		port => 6379
		data_type => 'list'
		key => 'logstash:unparsed'
		congestion_interval => 1
		congestion_threshold => 50000000
		batch => true
		batch_events => {{ BATCH }}
		password => '{{ REDIS_PASS }}'
	}
}
