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