# Binding local port for Logstash http output plugin

**URL:** <https://discuss.elastic.co/t/binding-local-port-for-logstash-http-output-plugin/172877>\
**Category:** Logstash\
**Created:** [March 19, 2019, 12:07am UTC](https://discuss.elastic.co/t/binding-local-port-for-logstash-http-output-plugin/172877 "2019-03-19T00:07:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quiza12](https://avatars.discourse-cdn.com/v4/letter/q/58956e/32.png) [@Quiza12](https://discuss.elastic.co/u/Quiza12)\
**Post date:** [March 19, 2019, 12:07am UTC](https://discuss.elastic.co/t/binding-local-port-for-logstash-http-output-plugin/172877/1 "2019-03-19T00:07:21Z")

</div>

Hi all,

I'm using the logstash-http-output plugin to send logs (converted to a SOAP message during filtering) to an endpoint on another server.

I'm having problems trying to find a way to bind a local port for the http output plugin. This is for the firewall purposes - currently it sends out on a random port (often in the tcp/50000-60000 range). For the connection to be accepted, I to specifically define this connection between the two servers and two distinct ports for the traffic to be allowed both ways. Is there any way I can do this?

Plugin code:

http {  
url =\> "URL-to-soap-endpoint"  
http\_method =\> "post"  
content\_type =\> "text/xml;charset=UTF-8"  
format =\> "message"  
message =\> '\<soap:Envelope SOAP MESSAGE \</soap:Envelope\>'  
}

Thanks!

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 19, 2019, 12:42am UTC](https://discuss.elastic.co/t/binding-local-port-for-logstash-http-output-plugin/172877/2 "2019-03-19T00:42:29Z")

</div>

I would expect your firewall to allow a configuration that specified a random ephemeral port on one side to connect to a specific port on the other side.

It's really a firewall question than a logstash question. You cannot constrain the port number on the source side.

---

<div class="post-metadata">

**Author:** ![Quiza12](https://avatars.discourse-cdn.com/v4/letter/q/58956e/32.png) [@Quiza12](https://discuss.elastic.co/u/Quiza12)\
**Post date:** [March 19, 2019, 12:58am UTC](https://discuss.elastic.co/t/binding-local-port-for-logstash-http-output-plugin/172877/3 "2019-03-19T00:58:35Z")

</div>

Thanks for the reply Badger. Understood.

---

<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:** [April 16, 2019, 12:58am UTC](https://discuss.elastic.co/t/binding-local-port-for-logstash-http-output-plugin/172877/4 "2019-04-16T00:58:40Z")

</div>

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