---
title: Elastic Agent to Logstash for routing to multiple Elasticsearch clusters and additional destinations
description: Info on configuring Elastic Agent: Fleet and Elastic Agent Guide, Configuring outputs for Elastic Agent. Info on Logstash and Logstash outputs: Logstash...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4236/manage-data/ingest/ingest-reference-architectures/ls-multi
products:
  - Elastic Agent
  - Logstash
---

# Elastic Agent to Logstash for routing to multiple Elasticsearch clusters and additional destinations
![Image showing Elastic Agent collecting and routing data to multiple destinations](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4236/manage-data/images/ingest-ea-ls-multi.png)

<definitions>
  <definition term="Ingest model">
    Elastic Agent to Logstash to Elasticsearch clusters and additional destinations
  </definition>
  <definition term="Use when">
    Data collected by Elastic Agent needs to be routed to different Elasticsearch clusters or non-Elasticsearch destinations depending on the content
  </definition>
  <definition term="Example">
    Let’s take an example of a Windows workstation, for which we are collecting different types of logs using the System and Windows integrations. These logs need to be sent to different Elasticsearch clusters and to S3 for backup and a mechanism to send it to other destinations such as different SIEM solutions. In addition, the Elasticsearch destination is derived based on the type of data stream and an organization identifier.
    In such use cases, agents send the data to Logstash as a routing mechanism to different destinations. The System and Windows integrations must be installed on all Elasticsearch clusters to which the data is routed.
  </definition>
  <definition term="Sample config">
    ```ruby
    input {
    elastic_agent {
    port => 5044
    }
    }
    filter {
    translate {
    source => "[http][host]"
    target => "[@metadata][tenant]"
    dictionary_path => "/etc/conf.d/logstash/tenants.yml"
    }
    }
    output {
    if [@metadata][tenant] == "tenant01" {
    elasticsearch {
      cloud_id => "<cloud id>"
      api_key => "<api key>"
    }
    } else if [@metadata][tenant] == "tenant02" {
    elasticsearch {
      cloud_id => "<cloud id>"
      api_key => "<api key>"
    }
    }
    }
    ```
  </definition>
</definitions>


## Resources

Info on configuring Elastic Agent:
- [Fleet and Elastic Agent Guide](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4236/reference/fleet)
- [Configuring outputs for Elastic Agent](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4236/reference/fleet/elastic-agent-output-configuration)

Info on Logstash and Logstash outputs:
- [Logstash Reference](https://docs-v3-preview.elastic.dev/elastic/logstash/tree/main/reference)
- [Logstash Elasticsearch output plugin](https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/lsr/plugins-outputs-elasticsearch)
- [Logstash output plugins](https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/lsr/output-plugins)

Info on Elasticsearch:
- [Elasticsearch Guide](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference)