# Only can bind logstash http\_address to 127.0.0.1

**URL:** https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413
**Category:** Logstash
**Created:** [April 6, 2017, 6:03am UTC](https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413 "2017-04-06T06:03:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![batrako](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/batrako/32/17116_2.png) [@batrako](https://discuss.elastic.co/u/batrako)
#### Post date: [April 6, 2017, 6:03am UTC](https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413/1 "2017-04-06T06:03:39Z")

</div>

I'm trying access to monitornig API from outside of logstash server but always bind to 127.0.0.1:9600 . In my logstash.yml config i set http.host with dns, ip,... but always bind to 127.0.0.1:9600.

one of my example config:  
.  
.  
http.host: "10.113.156.116"

I only can access to monitoring API from localhost , curl localhost:9600 and the result is:

{"host":"[logstash01.xxxxxx.es](http://logstash01.xxxxxx.es)","version":"5.2.1","http\_address":" **127.0.0.1:9600**","id":"f4f846be-bad2-4466-abe6-2d5f26b7d641","name":"[logstash01.xxxxxxxxx.es](http://logstash01.xxxxxxxxx.es)","build\_date":"2017-02-09T22:23:22+00:00","build\_sha":"05f2600cccbabf9ded7787d8eefaa498111d4320","build\_snapshot":false}

is posible bind http\_address to IP/name especified in http.host config parameter?

Thanks

---

<div class="post-metadata">

### Author: ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)
#### Post date: [April 7, 2017, 10:56am UTC](https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413/2 "2017-04-07T10:56:38Z")

</div>

I just tried with logstash 5.2.1 and I was able to set `http.host: 192.168.0.187` which is my local lan ip.

can you make sure your logstash.yml line isn't commented out?

Are there any error messages? Also, if you run logstash with `--log.level=debug` it will print all settings at the start, and say which ones are modified:

```auto
/tmp/logstash-5.2.1 % bin/logstash -e "" --log.level=debug
[2017-04-07T11:53:37,932][DEBUG][logstash.runner] -------- Logstash Settings (* means modified) ---------
[2017-04-07T11:53:37,935][DEBUG][logstash.runner] path.data: "/tmp/logstash-5.2.1/data"
[2017-04-07T11:53:37,935][DEBUG][logstash.runner] *config.string: ""
[2017-04-07T11:53:37,935][DEBUG][logstash.runner] config.test_and_exit: false
[2017-04-07T11:53:37,935][DEBUG][logstash.runner] config.reload.automatic: false
[2017-04-07T11:53:37,935][DEBUG][logstash.runner] config.reload.interval: 3
[2017-04-07T11:53:37,936][DEBUG][logstash.runner] metric.collect: true
[2017-04-07T11:53:37,936][DEBUG][logstash.runner] pipeline.id: "main"
[2017-04-07T11:53:37,936][DEBUG][logstash.runner] pipeline.workers: 4
[2017-04-07T11:53:37,937][DEBUG][logstash.runner] pipeline.output.workers: 1
[2017-04-07T11:53:37,937][DEBUG][logstash.runner] pipeline.batch.size: 125
[2017-04-07T11:53:37,937][DEBUG][logstash.runner] pipeline.batch.delay: 5
[2017-04-07T11:53:37,937][DEBUG][logstash.runner] pipeline.unsafe_shutdown: false
[2017-04-07T11:53:37,937][DEBUG][logstash.runner] path.plugins: []
[2017-04-07T11:53:37,938][DEBUG][logstash.runner] config.debug: false
[2017-04-07T11:53:37,938][DEBUG][logstash.runner] *log.level: "debug" (default: "info")
[2017-04-07T11:53:37,938][DEBUG][logstash.runner] version: false
[2017-04-07T11:53:37,939][DEBUG][logstash.runner] help: false
[2017-04-07T11:53:37,939][DEBUG][logstash.runner] log.format: "plain"
[2017-04-07T11:53:37,939][DEBUG][logstash.runner] *http.host: "192.168.0.187" (default: "127.0.0.1")

```

---

<div class="post-metadata">

### Author: ![batrako](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/batrako/32/17116_2.png) [@batrako](https://discuss.elastic.co/u/batrako)
#### Post date: [April 10, 2017, 9:58am UTC](https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413/3 "2017-04-10T09:58:10Z")

</div>

Thanks for your response João. Yes, my logsgash.yml isn't commented

```
logstash.yml

# Bind address for the metrics REST endpoint
#
 http.host: "10.125.1.174"

```

No error messages in log...

[2017-04-10T09:15:03,171][INFO][logstash.pipeline] Starting pipeline {"id"=\>"main", "pipeline.workers"=\>1, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>5, "pipeline.max\_inflight"=\>125}  
[2017-04-10T09:15:03,202][INFO][logstash.pipeline] Pipeline main started  
[2017-04-10T09:15:03,278][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2017-04-10T09:16:01,339][WARN][logstash.runner] SIGTERM received. Shutting down the agent.  
[2017-04-10T09:16:01,348][WARN][logstash.agent] stopping pipeline {:id=\>"main"}  
[2017-04-10T09:16:06,359][WARN][logstash.shutdownwatcher] {"inflight\_count"=\>0, "stalling\_thread\_info"=\>{}}  
[2017-04-10T09:16:06,361][ERROR][logstash.shutdownwatcher] The shutdown process appears to be stalled due to busy or blocked plugins. Check the logs for more information.  
[2017-04-10T09:31:18,277][DEBUG][logstash.runner] -------- Logstash Settings (\* means modified) ---------  
[2017-04-10T09:31:18,293][DEBUG][logstash.runner] **[node.name](http://node.name): "elkdev01**"  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] _path.config: "/apps/elastic/config/Logstash/Config/_.conf"  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] \*path.data: "/datos/apps/elastic/Logstash" (default: "/apps/elastic/logstash-5.2.1/data")  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] config.test\_and\_exit: false  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] config.reload.automatic: false  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] config.reload.interval: 3  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] metric.collect: true  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] [pipeline.id](http://pipeline.id): "main"  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] pipeline.workers: 1  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] pipeline.output.workers: 1  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] pipeline.batch.size: 125  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] pipeline.batch.delay: 5  
[2017-04-10T09:31:18,294][DEBUG][logstash.runner] pipeline.unsafe\_shutdown: false  
[2017-04-10T09:31:18,295][DEBUG][logstash.runner] path.plugins: []  
[2017-04-10T09:31:18,295][DEBUG][logstash.runner] config.debug: false  
[2017-04-10T09:31:18,295][DEBUG][logstash.runner] \*log.level: "debug" (default: "info")  
[2017-04-10T09:31:18,295][DEBUG][logstash.runner] version: false  
[2017-04-10T09:31:18,295][DEBUG][logstash.runner] help: false  
[2017-04-10T09:31:18,295][DEBUG][logstash.runner] log.format: "plain"  
[2017-04-10T09:31:18,295][DEBUG][logstash.runner] **http.host: "127.0.0.1"**  
[2017-04-10T09:31:18,296][DEBUG][logstash.runner] http.port: 9600..9700  
[2017-04-10T09:31:18,296][DEBUG][logstash.runner] http.environment: " **production**"

---

<div class="post-metadata">

### Author: ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)
#### Post date: [April 10, 2017, 6:21pm UTC](https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413/4 "2017-04-10T18:21:28Z")

</div>

can you make sure the `http.host: ..` line doesn't have any whitespace at the beginning? it seems the yaml parser we're using is discarding that line since there's a whitespace

---

<div class="post-metadata">

### Author: ![batrako](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/batrako/32/17116_2.png) [@batrako](https://discuss.elastic.co/u/batrako)
#### Post date: [April 12, 2017, 5:41am UTC](https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413/5 "2017-04-12T05:41:24Z")

</div>

YESSSSSS!!!! Thanks. http\_address bind on 127.0.0.1 if the line http.host doesn't have any whitespace or only one whitespace. If http.host is indented with 2 whitespaces, http\_address is binded correctly.  
Is strange that the rest of config variables are readed correctly with one whitespace.  
Thanks for Helpme João.

---

<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: [May 10, 2017, 5:50am UTC](https://discuss.elastic.co/t/only-can-bind-logstash-http-address-to-127-0-0-1/81413/6 "2017-05-10T05:50:43Z")

</div>

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