{%- if grains['role'] == 'so-eval' -%}
{%- set ES = salt['pillar.get']('manager:mainip', '') -%}
{%- else %}
{%- set ES = salt['pillar.get']('elasticsearch:mainip', '') -%}
{%- endif %}
output {
  if "beat-ext" in [tags] and "import" not in [tags] {
    elasticsearch {
      pipeline => "beats.common" 
      hosts => "{{ ES }}"
      index => "so-beats"
      template_name => "so-beats"
      template => "/templates/so-beats-template.json"
      template_overwrite => true
      ssl => true
      ssl_certificate_verification => false
    }
  }
}
