# TCP input and http output plugin configuration is not working

**URL:** https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907
**Category:** Logstash
**Created:** [May 7, 2018, 9:06pm UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907 "2018-05-07T21:06:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)
#### Post date: [May 7, 2018, 9:06pm UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907/1 "2018-05-07T21:06:44Z")

</div>

Hi,

I am running logstash with tcp input and http output plugin(which is sending to another logstash from which it would be to ES) and I don't see any logs in ES. But when I replace tcp plugin with udp, I see logs in ES. Logstash logs don't say anything here.

Can someone please explain me what the issue is?

Thanks

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [May 8, 2018, 6:39am UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907/2 "2018-05-08T06:39:45Z")

</div>

What does your configuration look like? When using the tcp input, is Logstash actually listening on a network interface that's accessible to whatever is attempting to send data? Have you tried sending data by hand with e.g. telnet or netcat?

Also, simplify your setup while debugging the problem. Reconfigure the first Logstash instance to only have a `stdout { codec => rubydebug }` output.

---

<div class="post-metadata">

### Author: ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)
#### Post date: [May 8, 2018, 1:25pm UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907/4 "2018-05-08T13:25:08Z")

</div>

Hi Magnus,

My config is something like,

```
input {
  tcp {
     host => "nodename"
     port => 514
     type => "syslog"
  }
}
filter{
...
}
output{
http {
			url=> "http://xxx.xx.xx:443"
			http_method=> "post"
			format=> "json"   
		}

file {
                       path => "/tmp/logstash/output.log"
                }

}
}

```

Log source for this logstash is coming from Syslog server over tcp port 514(will be changed to udp whenever needed).

I observed one more weird thing here- when using tcp input plugin, it's able to write to file but not sending anything over http output plugin.

When tcp input plugin is replaced by udp input plugin, output is being written to both file and over http output plugin.

Please let me know if something is not clear.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [May 8, 2018, 1:30pm UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907/5 "2018-05-08T13:30:50Z")

</div>

Are you running Logstash as root or implementing a workaround to get Logstash to listen on port 514?

> ```
> url=> "http://xxx.xx.xx:443"
> 
> ```

Surely it's http **s** on port 443.

I repeat:

- Have you tried sending data by hand with e.g. telnet or netcat?
- Also, simplify your setup while debugging the problem. Reconfigure the first Logstash instance to only have a `stdout { codec => rubydebug }` output.

---

<div class="post-metadata">

### Author: ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://discuss.elastic.co/u/amruth)
#### Post date: [May 8, 2018, 2:00pm UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907/6 "2018-05-08T14:00:18Z")

</div>

> [@magnusbaeck](#):
>
> Are you running Logstash as root or implementing a workaround to get Logstash to listen on port 514?

Yes, I am running Logstash as root

> [@magnusbaeck](#):
>
> Surely it's https on port 443.

Do I need to use https instead of http? But it is working with http too(except when I change my input plugin to tcp)

> [@magnusbaeck](#):
>
> Have you tried sending data by hand with e.g. telnet or netcat?

since my data is getting stored on local file when using tcp input plugin, do I still need to send data by hand?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [May 8, 2018, 7:24pm UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907/7 "2018-05-08T19:24:49Z")

</div>

> Do I need to use https instead of http? But it is working with http too(except when I change my input plugin to tcp)

That's surprising, but you should make sure the protocol declaration matches reality (so you should probably use https://).

> since my data is getting stored on local file when using tcp input plugin, do I still need to send data by hand?

Probably not since the data appears to reach the Logstash pipeline.

---

<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 5, 2018, 7:25pm UTC](https://discuss.elastic.co/t/tcp-input-and-http-output-plugin-configuration-is-not-working/130907/8 "2018-06-05T19:25:04Z")

</div>

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