# How to Handle Multiple Heterogeneous Inputs With Logstash?

Here's how you can manage multiple heterogeneous inputs with Logstash, enabling the Logstash pipeline to process and route logs from various sources to different destinations.

Logstash's configuration file allows you to define a `type` option within input plugins, which adds a `type` field to all events handled by those specific inputs. For example:

```text
input {
    file {
        type => "web_server_logs"
        path => "/var/log/apache/access.log"
    }
    file {
        type => "application_logs"
        path => "/var/log/app/application.log"
    }
}
```

In this configuration, two input plugins are defined to read logs from different sources. The first plugin reads Apache access logs and assigns a `type` of `web_server_logs`, while the second plugin reads application logs and assigns a `type` of `application_logs`.

Using the `type` field, you can filter the logs separately using conditional statements in the filter section, like so:

```text
filter {
    if [type] == "web_server_logs" {
        # Perform processing specific to web server logs
    }
    if [type] == "application_logs" {
        # Perform processing specific to application logs
    }
}
```

Additionally, you can forward the logs to different destinations based on their types using the `type` field:

```text
output {
    if [type] == "web_server_logs" {
        elasticsearch {
            // Send logs to Elasticsearch 
        }
    }
    if [type] == "application_logs" {
        file {
            path => "/var/log/app_processed/application_processed.log"
        }
    }
}
```
.

To further your understanding of Logstash, explore our [comprehensive guide](https://betterstack.com/community/guides/logging/logstash-explained/) on collecting, processing, and forwarding logs to various destinations.