# LOGSTASH Config file error, doesn't like host assigning but it requires one

**URL:** <https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142>\
**Category:** Logstash\
**Created:** [June 17, 2016, 10:40am UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142 "2016-06-17T10:40:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandonmcgrath1](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brandonmcgrath1](https://discuss.elastic.co/u/brandonmcgrath1)\
**Post date:** [June 17, 2016, 10:40am UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142/1 "2016-06-17T10:40:09Z")

</div>

I'm trying to configure logstash and this is the error im getting:

{:timestamp=\>"2016-06-17T11:36:27.128000+0100", :message=\>"Could not start TCP server: Address in use", :host=\>"elk.etechdc.local", :port=\>3515, :level=\>:error}

Logstash Conf is:  
input {  
tcp {  
codec =\> json\_lines { charset =\> CP1252 }  
port =\> 3515  
host =\> "elk.etechdc.local"  
tags =\> ["tcpjson"]  
}  
}  
filter {  
date {  
locale =\> "en"  
timezone =\> "Etc/GMT"  
match =\> ["EventTime", "YYYY-MM-dd HH:mm:ss"]  
}  
}  
output {  
elasticsearch {  
hosts =\> localhost  
}  
stdout { codec =\> rubydebug }  
}

---

<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:** [June 17, 2016, 10:42am UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142/2 "2016-06-17T10:42:25Z")

</div>

Some process is already listening on port 3515. If you're starting Logstash as a daemon with e.g. `service logstash start` or if you're passing the path to a directory via `-f`, make sure you the configuration file directory doesn't contain any unexpected files like e.g. a backup file that contains the same tcp input.

---

<div class="post-metadata">

**Author:** ![brandonmcgrath1](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brandonmcgrath1](https://discuss.elastic.co/u/brandonmcgrath1)\
**Post date:** [June 17, 2016, 10:55am UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142/3 "2016-06-17T10:55:34Z")

</div>

I've checked and the only other process is "JAVA.EXE" which I imagine is logstash its self? Even if I change the port its still giving the same error.

---

<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:** [June 17, 2016, 10:59am UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142/4 "2016-06-17T10:59:37Z")

</div>

java.exe _could_ be a Logstash instance. You can e.g. use Process Explorer to see the command line of any process.

---

<div class="post-metadata">

**Author:** ![brandonmcgrath1](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@brandonmcgrath1](https://discuss.elastic.co/u/brandonmcgrath1)\
**Post date:** [June 17, 2016, 12:45pm UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142/5 "2016-06-17T12:45:34Z")

</div>

it is logstash, if i run: logstash.bat -f logstash.json \>\> log.log  
this is what it dumps:

{:timestamp=\>"2016-06-17T13:44:03.934000+0100", :message=\>"Could not start TCP server: Address in use", :host=\>"elk.etechdc.local", :port=\>3515, :level=\>:error}  
{:timestamp=\>"2016-06-17T13:44:03.934000+0100", :message=\>"Pipeline aborted due to error", :exception=\>#\<Errno::EADDRINUSE: Address already in use - bind - Address already in use: bind\>, :backtrace=\>["org/jruby/ext/socket/RubyTCPServer.java:118:in `initialize'", "org/jruby/RubyIO.java:853:in`new'", "c:/ulyaoth/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-tcp-3.0.4/lib/logstash/inputs/tcp.rb:244:in `new_server_socket'", "c:/ulyaoth/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-tcp-3.0.4/lib/logstash/inputs/tcp.rb:79:in`register'", "c:/ulyaoth/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:330:in `start_inputs'", "org/jruby/RubyArray.java:1613:in`each'", "c:/ulyaoth/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:329:in `start_inputs'", "c:/ulyaoth/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:180:in`start\_workers'", "c:/ulyaoth/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:136:in `run'", "c:/ulyaoth/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/agent.rb:465:in`start\_pipeline'"], :level=\>:error}  
{:timestamp=\>"2016-06-17T13:44:06.997000+0100", :message=\>"stopping pipeline", :id=\>"main"}

The CMD command won't run if i change the port to anything...

---

<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:** [June 17, 2016, 1:20pm UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142/6 "2016-06-17T13:20:55Z")

</div>

Is the port busy if you're not running Logstash?

---

<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:** [July 6, 2017, 4:52am UTC](https://discuss.elastic.co/t/logstash-config-file-error-doesnt-like-host-assigning-but-it-requires-one/53142/7 "2017-07-06T04:52:11Z")

</div>


