# Only one of the 2 TCP inputs is working

**URL:** https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112
**Category:** Logstash
**Created:** [July 18, 2019, 12:07am UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112 "2019-07-18T00:07:07Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nsm](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@nsm](https://discuss.elastic.co/u/nsm)
#### Post date: [July 18, 2019, 12:07am UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112/1 "2019-07-18T00:07:07Z")

</div>

I have two logstash configuration files under one folder. Following are the configurations for both files:

File 1:

```
    input
    {
        tcp {
            port => 50002
            add_field => { log_type => 'panw' }
        }
    }

    filter
    {
        #Filtering the data using mutate
    }

    output {
        stdout { codec => rubydebug }
        if [log_type] == 'panw'
            kafka {
                codec => line { format => "%{message}" }
                bootstrap_servers => '127.0.0.1:6667'
                topic_id => "traffic_logs"
            }
    }

```

File 2:

```
    input
    {
        tcp {
            port => 50001
            add_field => { log_type => 'proxy' }
        }
    }
    
    filter
    {
        #Filtering the data using mutate
    }

    output {
        stdout { codec => rubydebug }
        if [log_type] == 'proxy'
            kafka {
                codec => line { format => "%{message}" }
                bootstrap_servers => '127.0.0.1:6667'
                topic_id => "proxy_logs"
            }
    }

```

I can only see debug logs and kafka logs for the proxy conf. panw does not work. I don't see any errors or warnings either.  
I used tcpdump to make sure both ports are getting the data.

Also, both ports are listening

```
[centos@ip- ~]$ sudo netstat -lntp | grep 50002
tcp6 0 0 :::50002 :::* LISTEN 13863/java          
[centos@ip- ~]$ sudo netstat -lntp | grep 50001
tcp6 0 0 :::50001 :::* LISTEN 13863/java          

```

where 13863 is the logstash process

When I remove the proxy file from the conf dir, panw works perfectly. It doesn't work when I add the proxy conf.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 18, 2019, 6:10am UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112/2 "2019-07-18T06:10:17Z")

</div>

Does the proxy config work if you only use that? Is the data coming into that port newline separated? Can you try configuring them as [multiple distinct pipelines](https://www.elastic.co/guide/en/logstash/7.2/multiple-pipelines.html) and see if that makes a difference?

---

<div class="post-metadata">

### Author: ![nsm](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@nsm](https://discuss.elastic.co/u/nsm)
#### Post date: [July 18, 2019, 8:24pm UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112/3 "2019-07-18T20:24:40Z")

</div>

The proxy config works perfectly by itself. So does the panw.  
Data is newline separated.  
I will try using multiple pipelines. My understanding was that two tcp inputs with different ports should work in a single pipeline. Just wanted to know if I'm missing something here.

Thanks @Christian_Dahlqvist

---

<div class="post-metadata">

### Author: ![nsm](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@nsm](https://discuss.elastic.co/u/nsm)
#### Post date: [July 22, 2019, 10:44pm UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112/4 "2019-07-22T22:44:13Z")

</div>

Using multiple pipelines worked.  
But I'm still wondering what caused the problem in single pipeline.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 23, 2019, 5:09am UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112/5 "2019-07-23T05:09:47Z")

</div>

I wonder if it could be a threading issue around multiple inputs in a single pipeline, but am not familiar with the internals.

---

<div class="post-metadata">

### Author: ![nsm](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@nsm](https://discuss.elastic.co/u/nsm)
#### Post date: [July 23, 2019, 5:52pm UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112/6 "2019-07-23T17:52:18Z")

</div>

Maybe. I'll keep looking and will update if I find anything.  
Thanks @Christian_Dahlqvist

---

<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: [August 20, 2019, 5:52pm UTC](https://discuss.elastic.co/t/only-one-of-the-2-tcp-inputs-is-working/191112/7 "2019-08-20T17:52:29Z")

</div>

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