# HTTP Plugin port numbers

**URL:** <https://discuss.elastic.co/t/http-plugin-port-numbers/79153>\
**Category:** Logstash\
**Created:** [March 19, 2017, 12:57am UTC](https://discuss.elastic.co/t/http-plugin-port-numbers/79153 "2017-03-19T00:57:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpazhyannur](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rpazhyannur](https://discuss.elastic.co/u/rpazhyannur)\
**Post date:** [March 19, 2017, 12:57am UTC](https://discuss.elastic.co/t/http-plugin-port-numbers/79153/1 "2017-03-19T00:57:39Z")

</div>

I have two scripts using the HTTP plug listening on different ports (log stash is running on centos on an AWS instance)  
However, when I post something on one port both scripts are getting the HTTP request.

script 1  
input {  
http {  
host =\> "0.0.0.0"  
port =\> 31312 # default: 8080  
}  
}  
....

script 2  
input {  
http {  
host =\> "0.0.0.0"  
port =\> 31311 # default: 8080  
}  
}

---

<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:** [March 20, 2017, 7:59am UTC](https://discuss.elastic.co/t/http-plugin-port-numbers/79153/2 "2017-03-20T07:59:27Z")

</div>

What does the rest of your configuration look like? What makes you reach the conclusion that both http inputs are receiving the same HTTP request?

---

<div class="post-metadata">

**Author:** ![rpazhyannur](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rpazhyannur](https://discuss.elastic.co/u/rpazhyannur)\
**Post date:** [March 20, 2017, 3:46pm UTC](https://discuss.elastic.co/t/http-plugin-port-numbers/79153/3 "2017-03-20T15:46:40Z")

</div>

script 1

input {  
http {  
host =\> "0.0.0.0"  
port =\> 31311 # default: 8080  
}  
}

output {  
stdout {  
codec =\> rubydebug  
}  
elasticsearch{  
hosts =\> "localhost"  
index =\> "iot\_collector-1"  
}  
}

# script 2

input {  
http {  
host =\> "0.0.0.0"  
port =\> 31312 # default: 8080  
}  
}

output {  
stdout {  
codec =\> rubydebug  
}  
elasticsearch{  
hosts =\> "localhost"  
index =\> "iot\_collector"  
}  
}

When I use postman to post on port 31311, i get entries both index iot\_collector and iot\_collector-1. (To be clear, this is not my actual script but I simplified it to debug this problem.)

thanks

Rajesh

---

<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:** [March 20, 2017, 4:03pm UTC](https://discuss.elastic.co/t/http-plugin-port-numbers/79153/4 "2017-03-20T16:03:52Z")

</div>

This is expected. Logstash has a single event pipeline that feeds events from all inputs to all filters and then to all outputs. If you don't like that you need to introduce conditionals to choose which events go where. Putting configuration into different files doesn't matter.

---

<div class="post-metadata">

**Author:** ![rpazhyannur](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rpazhyannur](https://discuss.elastic.co/u/rpazhyannur)\
**Post date:** [March 20, 2017, 4:28pm UTC](https://discuss.elastic.co/t/http-plugin-port-numbers/79153/5 "2017-03-20T16:28:03Z")

</div>

Thank you for the quick response.  
I did notice when I ran the two scripts separately on the command line, I did not have this problem. I had the problem only when I put both scripts in /etc/logstash/conf.d (and I am assuming that in that case this is a single instance)

---

<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 17, 2017, 4:28pm UTC](https://discuss.elastic.co/t/http-plugin-port-numbers/79153/6 "2017-04-17T16:28:07Z")

</div>

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