batrako
(Iván José Alvarez Domínguez)
April 6, 2017, 6:03am
1
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 ","version":"5.2.1","http_address":"127.0.0.1:9600 ","id":"f4f846be-bad2-4466-abe6-2d5f26b7d641","name":"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
jsvd
(João Duarte)
April 7, 2017, 10:56am
2
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:
/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")
batrako
(Iván José Alvarez Domínguez)
April 10, 2017, 9:58am
3
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 : "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 : "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 "
jsvd
(João Duarte)
April 10, 2017, 6:21pm
4
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
2 Likes
batrako
(Iván José Alvarez Domínguez)
April 12, 2017, 5:41am
5
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.
1 Like
system
(system)
Closed
May 10, 2017, 5:50am
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.