# Persist transformed logs to Elasticsearch

input {
    kafka {
        zk_connect => "{{ monasca_zookeeper_servers }}"
        topic_id => "{{ monasca_transformed_logs_topic }}"
        group_id => "log_persister"
        consumer_id => "log_persister_{{ ansible_hostname }}"
        consumer_threads => "{{ monasca_log_pipeline_threads }}"
    }
}

output {
    elasticsearch {
        index => "monasca-%{[meta][tenantId]}-%{+YYYY.MM.dd}"
        hosts => [{{ monasca_elasticsearch_servers }}]
        document_type => "log"
        template_name => "monasca"
        template => "/etc/logstash/elasticsearch-template.json"
    }
}
