# Test run fails

**URL:** <https://discuss.elastic.co/t/test-run-fails/250706>\
**Category:** Logstash\
**Created:** [October 1, 2020, 3:07pm UTC](https://discuss.elastic.co/t/test-run-fails/250706 "2020-10-01T15:07:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)\
**Post date:** [October 1, 2020, 3:07pm UTC](https://discuss.elastic.co/t/test-run-fails/250706/1 "2020-10-01T15:07:38Z")

</div>

Hi,  
I have Logstash (on a seperate server to ES) set to run as a service, but wanted to test it first by running  
`\bin\logstash.bat -f .\config\logstash-conf.conf`  
However when I run this it appears to start but then stop, is this normal behaviour:

```auto
PS D:\Logstash\logstash-7.9.2\bin> .\logstash.bat -f .\config\Logstash-conf.conf
Sending Logstash logs to D:/Logstash/logstash-7.9.2/logs which is now configured via log4j2.properties
[2020-10-01T15:58:11,353][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"7.9.2", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) Client VM 25.261-b12 on 1.8.0_261-b12 +indy +jit [mswin32-i386]"}
[2020-10-01T15:58:11,556][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2020-10-01T15:58:11,962][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=>"D:/Logstash/logstash-7.9.2/bin/config/Logstash-conf.conf"}
[2020-10-01T15:58:11,962][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.
[2020-10-01T15:58:12,181][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2020-10-01T15:58:17,329][INFO][logstash.runner] Logstash shut down.
[2020-10-01T15:58:17,361][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

```

If I start the service it runs and stays running, so thought it should be OK.  
The conf file contents are (I have not yet set up Beats on another server to push logs to LS):

```auto
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  beats {
    port => 5044
  }
}

output {
  elasticsearch {
    hosts => "10.103.186.210:9200"
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }
}

```

---

<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:** [October 1, 2020, 3:14pm UTC](https://discuss.elastic.co/t/test-run-fails/250706/2 "2020-10-01T15:14:13Z")

</div>

> [@Craig2188](#):
>
> `No config files found in path {:path=>"D:/Logstash/logstash-7.9.2/bin/config/Logstash-conf.conf"}`

It seems highly unlikely that logstash would look for that file if you started it with

```
\bin\logstash.bat -f .\config\logstash-conf.conf

```

---

<div class="post-metadata">

**Author:** ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)\
**Post date:** [October 1, 2020, 3:29pm UTC](https://discuss.elastic.co/t/test-run-fails/250706/3 "2020-10-01T15:29:51Z")

</div>

Ah yep, corrected that, now got a new error:

```auto
[2020-10-01T16:28:22,559][WARN][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://localhost:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://localhost:9200/][Manticore::SocketException] Connection refused: connect"}
[2020-10-01T16:28:23,372][WARN][logstash.runner] SIGINT received. Shutting down.

```

---

<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:** [October 1, 2020, 3:33pm UTC](https://discuss.elastic.co/t/test-run-fails/250706/4 "2020-10-01T15:33:11Z")

</div>

> [@Craig2188](#):
>
> `Elasticsearch Unreachable: [http://localhost:9200/]`

Is elasticsearch listening on localhost?

---

<div class="post-metadata">

**Author:** ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)\
**Post date:** [October 1, 2020, 3:34pm UTC](https://discuss.elastic.co/t/test-run-fails/250706/5 "2020-10-01T15:34:48Z")

</div>

Crap, sorry, forgot to mention ES is on another server... I can't see where and what file I need to tell LS to look at for the ES server. Not easily searchable online

---

<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:** [October 1, 2020, 3:45pm UTC](https://discuss.elastic.co/t/test-run-fails/250706/6 "2020-10-01T15:45:56Z")

</div>

> [@Craig2188](#):
>
> ```auto
> elasticsearch {
> hosts => "10.103.186.210:9200"
> 
> ```

That is how you tell logstash where to connect to. I cannot explain why it would be connecting to localhost if you actually have that in your configuration.

---

<div class="post-metadata">

**Author:** ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)\
**Post date:** [October 1, 2020, 3:57pm UTC](https://discuss.elastic.co/t/test-run-fails/250706/7 "2020-10-01T15:57:51Z")

</div>

Ah interesting, I just started the service to see what the LS log file would state, as when running it via CLI it had lots of errors about connecting to localhost for ES as well. When running it as a service, it sees the correct IP address according to the conf file

---

<div class="post-metadata">

**Author:** ![Craig2188](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@Craig2188](https://discuss.elastic.co/u/Craig2188)\
**Post date:** [October 2, 2020, 10:43am UTC](https://discuss.elastic.co/t/test-run-fails/250706/8 "2020-10-02T10:43:56Z")

</div>

Found the issue, was due to the elastic YML file not having network.host: 0.0.0.0 being set which wasn't working due to some further missing config in the YML file which allowed the service to start:

```auto
discovery.seed_hosts: []
discovery.type: single-node

```

---

<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:** [October 30, 2020, 10:43am UTC](https://discuss.elastic.co/t/test-run-fails/250706/9 "2020-10-30T10:43:58Z")

</div>

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