# Multiple inputs in logstash

**URL:** https://discuss.elastic.co/t/multiple-inputs-in-logstash/234849
**Category:** Logstash
**Created:** [May 29, 2020, 2:18am UTC](https://discuss.elastic.co/t/multiple-inputs-in-logstash/234849 "2020-05-29T02:18:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vikramaddagulla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikramaddagulla/32/139858_2.png) [@vikramaddagulla](https://discuss.elastic.co/u/vikramaddagulla)
#### Post date: [May 29, 2020, 2:18am UTC](https://discuss.elastic.co/t/multiple-inputs-in-logstash/234849/1 "2020-05-29T02:18:45Z")

</div>

Hello,

We are currently running filebeats and sending the data to logstash and that is working fine.

We are now working on a new set up which need to connect to an Oracle Database and get data from a table.

I understand this will need the jdbc plugin.

I would like to know if this can be achieved in the current config file ?? If yes, how ???

Or does it need a new config file for logstash ? If yes how can I run two different config files in a single logstash instance ?

Below is my scenario :

Current Config File looks like below :

```auto
input {
    # Your input config
}

filter {
    # Your filter logic
}

output {
    # Your output config
}

```

Expected : Does the below expected pattern work ?

```auto
input {
    beats {
        type => "beats_events"
        # Add rest of beats config
    }
    jdbc {
        type => "jdbc_events"
        # Add rest of jdbc config
    }
}

filter {
    if [type] == "beats_events" {
        # Add beats event filter logic
    }

    if [type] == "jdbc_events" {
        # Add jdbc event filter logic
    }
}

output {
    if [type] == "beats_events" {
        # Add beats event output config
    }
    if [type] == "jdbc_events" {
        # Add jdbc event output config
    }
}

```

---

<div class="post-metadata">

### Author: ![tamilsweet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tamilsweet/32/54127_2.png) [@tamilsweet](https://discuss.elastic.co/u/tamilsweet)
#### Post date: [May 29, 2020, 5:45am UTC](https://discuss.elastic.co/t/multiple-inputs-in-logstash/234849/2 "2020-05-29T05:45:07Z")

</div>

Yes. You can use if ... else if...

```auto
filter {
    if [type] == "beats_events" {
        # Add beats event filter logic
    } else if [type] == "jdbc_events" {
        # Add jdbc event filter logic
    }
}

output {
    if [type] == "beats_events" {
        # Add beats event output config
    } else if [type] == "jdbc_events" {
        # Add jdbc event output config
    } else {
        # Add the unknown event output config - store it in separate index to see why you have some unknown events.
    }
}

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 26, 2020, 5:45am UTC](https://discuss.elastic.co/t/multiple-inputs-in-logstash/234849/3 "2020-06-26T05:45:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
