# ERROR: Unknown command 'Logstash'

**URL:** https://discuss.elastic.co/t/error-unknown-command-logstash/187620
**Category:** Logstash
**Created:** [June 26, 2019, 4:06pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620 "2019-06-26T16:06:47Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin\_Juliano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_juliano/32/48845_2.png) [@Kevin\_Juliano](https://discuss.elastic.co/u/Kevin_Juliano)
#### Post date: [June 26, 2019, 4:06pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/1 "2019-06-26T16:06:47Z")

</div>

Hi

I'm new to Logstash and I am following this blog ([https://www.elastic.co/blog/logstash-jdbc-input-plugin](https://www.elastic.co/blog/logstash-jdbc-input-plugin)) to connect postgresql to elasticsearch using logstash, but I am getting this error:

```
logstash-7.2.0/bin/logstash -f simple-out.conf Logstash startup
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/logstash-core/lib/jars/jruby-complete-9.2.7.0.jar) to field java.io.FileDescriptor.fd
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Thread.exclusive is deprecated, use Thread::Mutex
ERROR: Unknown command 'Logstash'

See: 'bin/logstash --help'
[ERROR] 2019-06-26 23:32:17.130 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

```

I am using:

Ubuntu 18.04  
Postgres version: 10.8  
Elasticsearch version: 7.1.1  
Logstash: 7.2.0

Please Help.

---

<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: [June 26, 2019, 4:19pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/2 "2019-06-26T16:19:41Z")

</div>

> [@Kevin\_Juliano](#):
>
> logstash-7.2.0/bin/logstash -f simple-out.conf Logstash startup

logstash 1.5.3 is a very, very long time ago. Try

```
logstash-7.2.0/bin/logstash -f simple-out.conf

```

---

<div class="post-metadata">

### Author: ![Kevin\_Juliano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_juliano/32/48845_2.png) [@Kevin\_Juliano](https://discuss.elastic.co/u/Kevin_Juliano)
#### Post date: [June 26, 2019, 5:18pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/3 "2019-06-26T17:18:55Z")

</div>

Hi Badger, Thanks for your response, the error is now gone. but it come up with another, I'm not sure but I think it can't read the postgres jdbc driver?

```
logstash-7.2.0/bin/logstash -f simple-out.conf
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/logstash-core/lib/jars/jruby-complete-9.2.7.0.jar) to field java.io.FileDescriptor.fd
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Thread.exclusive is deprecated, use Thread::Mutex
Sending Logstash logs to /media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/logs which is now configured via log4j2.properties
[2019-06-27T01:07:02,652][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-06-27T01:07:02,716][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"7.2.0"}
[2019-06-27T01:07:05,416][WARN][org.logstash.instrument.metrics.gauge.LazyDelegatingGauge] A gauge metric of an unknown type (org.jruby.RubyArray) has been create for key: cluster_uuids. This may result in invalid serialization. It is recommended to log an issue to the responsible developer/development team.
[2019-06-27T01:07:05,422][INFO][logstash.javapipeline] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>500, :thread=>"#<Thread:0xc89fbb9 run>"}
[2019-06-27T01:07:07,674][INFO][logstash.javapipeline] Pipeline started {"pipeline.id"=>"main"}
[2019-06-27T01:07:07,804][INFO][logstash.agent] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2019-06-27T01:07:09,192][ERROR][logstash.inputs.jdbc] Failed to load /media/kevin/Kevin2017/work/psql-jdbc/postgresql-42.2.6.jar {:exception=>#<TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader>}
[2019-06-27T01:07:09,201][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2019-06-27T01:07:09,250][ERROR][logstash.javapipeline] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"postgres", statement=>"SELECT * from maincat", 
jdbc_driver_library=>"/media/kevin/Kevin2017/work/psql-jdbc/postgresql-42.2.6.jar", 
jdbc_connection_string=>"jdbc:postgresql://localhost:5432/kwheel", 
id=>"7df427291a77662b8c8485704940b8cf41c073e65835618e85f587fbcaa57dc0", jdbc_driver_class=>"org.postgresql.Driver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_0b6fc7e0-d7b7-46b5-9488-2afbbb88a4a2", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1970-01-01 00:00:00 UTC}, last_run_metadata_path=>"/home/kevin/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: org.postgresql.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError
 Stack: /media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:in `open_jdbc_connection'
/media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221:in `execute_statement'
/media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in `execute_query'
/media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in `run'
/media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/logstash-core/lib/logstash/java_pipeline.rb:309:in `inputworker'
/media/kevin/Kevin2017/work/psql-jdbc/logstash-7.2.0/logstash-core/lib/logstash/java_pipeline.rb:302:in `block in start_input'
[2019-06-27T01:07:10,260][ERROR][logstash.inputs.jdbc] Failed to load /media/kevin/Kevin2017/work/psql-jdbc/postgresql-42.2.6.jar {:exception=>#<TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader>}
[2019-06-27T01:07:10,264][ERROR][logstash.javapipeline] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
 Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"postgres", statement=>"SELECT * from maincat", 
jdbc_driver_library=>"/media/kevin/Kevin2017/work/psql-jdbc/postgresql-42.2.6.jar", jdbc_connection_string=>"jdbc:postgresql://localhost:5432/kwheel", id=>"7df427291a77662b8c8485704940b8cf41c073e65835618e85f587fbcaa57dc0", jdbc_driver_class=>"org.postgresql.Driver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_0b6fc7e0-d7b7-46b5-9488-2afbbb88a4a2", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1970-01-01 00:00:00 UTC}, last_run_metadata_path=>"/home/kevin/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: org.postgresql.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError
```

---

<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: [June 26, 2019, 5:31pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/4 "2019-06-26T17:31:40Z")

</div>

> [@Kevin\_Juliano](#):
>
> failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader\>}

Known issue. A workaround is mentioned [here](https://github.com/logstash-plugins/logstash-filter-jdbc_static/issues/47#issuecomment-496606449). Read down to the end of the thread for additional issues you might face.

---

<div class="post-metadata">

### Author: ![Kevin\_Juliano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_juliano/32/48845_2.png) [@Kevin\_Juliano](https://discuss.elastic.co/u/Kevin_Juliano)
#### Post date: [June 26, 2019, 6:41pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/5 "2019-06-26T18:41:21Z")

</div>

Hi Badger!

Thanks for the link, it helps me a lot! after a few trial and errors I already got it working! 🙂

---

<div class="post-metadata">

### Author: ![MARCO\_RAMBALDI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_rambaldi/32/46108_2.png) [@MARCO\_RAMBALDI](https://discuss.elastic.co/u/MARCO_RAMBALDI)
#### Post date: [July 1, 2019, 9:18am UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/6 "2019-07-01T09:18:54Z")

</div>

Hi,  
I was looking for a solution for my warning and ended up here ... in these logs I see the same warning, which came out without changing anything:

> [@Kevin\_Juliano](#):
>
> A gauge metric of an unknown type (org.jruby.RubyArray) has been create for key: cluster\_uuids. This may result in invalid serialization. It is recommended to log an issue to the responsible developer/development team.

Can you help me?

---

<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: [July 1, 2019, 12:47pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/7 "2019-07-01T12:47:35Z")

</div>

I started seeing that warning after upgrading to 7.2.0. It is a known [issue](https://github.com/elastic/logstash/issues/10886).

---

<div class="post-metadata">

### Author: ![MARCO\_RAMBALDI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_rambaldi/32/46108_2.png) [@MARCO\_RAMBALDI](https://discuss.elastic.co/u/MARCO_RAMBALDI)
#### Post date: [July 1, 2019, 12:52pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/8 "2019-07-01T12:52:37Z")

</div>

I noticed another strange warning: **Thread.exclusive is deprecated, use Thread::Mutex**.  
Is this a recognized warning too? @Badger

---

<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: [July 1, 2019, 12:54pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/9 "2019-07-01T12:54:46Z")

</div>

Nobody has opened an issue for it yet, but I also get that starting with 7.2.0.

---

<div class="post-metadata">

### Author: ![MARCO\_RAMBALDI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_rambaldi/32/46108_2.png) [@MARCO\_RAMBALDI](https://discuss.elastic.co/u/MARCO_RAMBALDI)
#### Post date: [July 1, 2019, 12:55pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/10 "2019-07-01T12:55:08Z")

</div>

Thanks!!

---

<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 29, 2019, 12:55pm UTC](https://discuss.elastic.co/t/error-unknown-command-logstash/187620/11 "2019-07-29T12:55:13Z")

</div>

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