{%- if grains['role'] == 'so-eval' -%} {%- set ES = salt['pillar.get']('manager:mainip', '') -%} {%- else %} {%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%} {%- endif %} output { if [event_type] == "sflow" { elasticsearch { hosts => "{{ ES }}" index => "so-flow" template_name => "so-flow" template => "/templates/so-flow-template.json" template_overwrite => true ssl => true ssl_certificate_verification => false } } }