# Clamp::UsageError: Unrecognised option '-c'

**URL:** <https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871>\
**Category:** Logstash\
**Created:** [March 31, 2016, 5:11am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871 "2016-03-31T05:11:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![seeni](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@seeni](https://discuss.elastic.co/u/seeni)\
**Post date:** [March 31, 2016, 5:11am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/1 "2016-03-31T05:11:36Z")

</div>

Clamp::UsageError: Unrecognised option '-c'

signal\_usage\_error at C:/.../Vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:103  
find\_option at C:/.../Vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/option/parsing.rb:62  
parse\_options at C:/.../Vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/option/parsing.rb:18  
parse at C:/.../Vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:52

my config file is as follows

input {  
file{  
path=\>"c:\NotbackedUp\DataSets\GOOG.csv"  
start\_position=\>"beginning"  
}  
}

filter{  
csv{  
columns=\>["Date","Open","High","Low","Close","Volume","Adj\_close"]  
separator=\>","  
}

date{  
match=\>["Date","yyyy-MM-dd"]  
}

mutate{  
convert=\>["Open","float"]  
convert=\>["High","float"]  
convert=\>["Low","float"]  
convert=\>["Close","float"]  
convert=\>["Volume","integer"]  
convert=\>["Adj\_close","float"]  
}  
}

output{

```
   elasticsearch{
             host=>"localhost"

             }
   }
```

---

<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:** [March 31, 2016, 5:32am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/2 "2016-03-31T05:32:55Z")

</div>

Which version of Logstash?

---

<div class="post-metadata">

**Author:** ![seeni](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@seeni](https://discuss.elastic.co/u/seeni)\
**Post date:** [March 31, 2016, 5:39am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/3 "2016-03-31T05:39:37Z")

</div>

Logstash 2.2.3

---

<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:** [March 31, 2016, 5:50am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/4 "2016-03-31T05:50:24Z")

</div>

There's something fishy here. How are you starting Logstash? Are you sure your Logstash installation is intact and consistent? Did you upgrade recently? Your configuration can't possibly won't work with LS 2.2 since the elasticsearch output's `host` option was renamed to `hosts`.

---

<div class="post-metadata">

**Author:** ![seeni](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@seeni](https://discuss.elastic.co/u/seeni)\
**Post date:** [March 31, 2016, 6:03am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/5 "2016-03-31T06:03:23Z")

</div>

Hi Magnus,

I am completely new bee to elastic search and been following a book on "Learning ELK Stack".

I have started the elasticsearch node and fired below command in new command prompt

bin/logstash -configtest logstash.conf

please advise if I need to perform any other steps to ensure correct setup of logstash.

Thanks  
Srinivas

---

<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:** [March 31, 2016, 6:33am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/6 "2016-03-31T06:33:20Z")

</div>

Oh. This is probably just a poor error message. Use `--configtest`, not `-configtest`. Note the double hyphen.

---

<div class="post-metadata">

**Author:** ![seeni](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@seeni](https://discuss.elastic.co/u/seeni)\
**Post date:** [March 31, 2016, 6:35am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/7 "2016-03-31T06:35:22Z")

</div>

Hi Magnus,

I have tried with '--configtest' with no luck

please find the details below

C:\NotBackedUp\logstash-2.2.3\logstash-2.2.3\bin\>logstash --conftest logstash.conf  
io/console not supported; tty will not be manipulated  
Clamp::UsageError: Unrecognised option '--conftest'  
signal\_usage\_error at C:/NotBackedUp/logstash-2.2.3/logstash-2.2.3/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:103  
find\_option at C:/NotBackedUp/logstash-2.2.3/logstash-2.2.3/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/option/parsing.rb:62  
parse\_options at C:/NotBackedUp/logstash-2.2.3/logstash-2.2.3/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/option/parsing.rb:28  
parse at C:/NotBackedUp/logstash-2.2.3/logstash-2.2.3/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:52  
run at C:/NotBackedUp/logstash-2.2.3/logstash-2.2.3/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.3-java/lib/logstash/runner.rb:79  
call at org/jruby/RubyProc.java:281  
run at C:/NotBackedUp/logstash-2.2.3/logstash-2.2.3/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.3-java/lib/logstash/runner.rb:95  
call at org/jruby/RubyProc.java:281  
initialize at C:/NotBackedUp/logstash-2.2.3/logstash-2.2.3/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/task.rb:24

---

<div class="post-metadata">

**Author:** ![seeni](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@seeni](https://discuss.elastic.co/u/seeni)\
**Post date:** [March 31, 2016, 6:36am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/8 "2016-03-31T06:36:32Z")

</div>

I just verified the working of logstash.. seems to be fine

C:\NotBackedUp\logstash-2.2.3\logstash-2.2.3\bin\>logstash -e 'input { stdin { } } output { stdout {} }'  
io/console not supported; tty will not be manipulated  
Settings: Default pipeline workers: 4  
HeLogstash startup completed  
hello logstash  
2016-03-31T06:27:52.944Z L68F72872493E Hehello logstash  
hi  
2016-03-31T06:28:12.348Z L68F72872493E hi  
Hello PacktPub  
{  
"message" =\> " Hello PacktPub",  
"@timestamp" =\> "2015-05-20T23:48:05.335Z",  
"@version" =\> "1",  
"host" =\> "packtpub"  
}2016-03-31T06:28:38.332Z L68F72872493E Hello PacktPub  
2016-03-31T06:28:38.334Z L68F72872493E {  
2016-03-31T06:28:38.335Z L68F72872493E "message" =\> " Hello PacktPub",  
2016-03-31T06:28:38.335Z L68F72872493E "@timestamp" =\> "2015-05-20T23:48:05.335Z",  
2016-03-31T06:28:38.335Z L68F72872493E "@version" =\> "1",  
2016-03-31T06:28:38.336Z L68F72872493E "host" =\> "packtpub"  
^CTerminate batch job (Y/N)? e[33mSIGINT received. Shutting down the pipeline. {:level=\>:warn}e[0m  
Logstash shutdown completed

---

<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:** [March 31, 2016, 6:38am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/9 "2016-03-31T06:38:01Z")

</div>

> I have tried with '--configtest' with no luck

> please find the details below

> C:\NotBackedUp\logstash-2.2.3\logstash-2.2.3\bin\>logstash --conftest logstash.conf  
> io/console not supported; tty will not be manipulated  
> Clamp::UsageError: Unrecognised option '--conftest'

Oh, come on. `--configtest`, not `--conftest`.

---

<div class="post-metadata">

**Author:** ![seeni](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@seeni](https://discuss.elastic.co/u/seeni)\
**Post date:** [March 31, 2016, 6:51am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/10 "2016-03-31T06:51:37Z")

</div>

Hi Magnus,

Thanks for correcting my silly mistake and for your patience.

I am able to pass through config test now.

I am facing an issue at logstash execution .... perhaps I may be giving incorrect "hosts"

The error is as follows

C:\NotBackedUp\logstash-2.2.3\logstash-2.2.3\bin\>logstash -f logstash.conf  
io/console not supported; tty will not be manipulated  
Settings: Default pipeline workers: 4  
e[31mError: The setting `port` in plugin `elasticsearch` is obsolete and is no longer available. Please use the 'hosts' setting instead. Hosts entries can be in 'host:port' format. If you have any questions about this, you are invited to visit [https://discuss.elastic.co/c/logstash](https://discuss.elastic.co/c/logstash) and ask. {:level=\>:error}e[0m

my config file is as follows

input {  
file{  
path=\>"c:\NotbackedUp\DataSets\GOOG.csv"  
start\_position=\>"beginning"  
}  
}

filter{  
csv{  
columns=\>["Date","Open","High","Low","Close","Volume","Adj\_close"]  
separator=\>","  
}

date{  
match=\>["Date","yyyy-MM-dd"]  
}

mutate{  
convert=\>["Open","float"]  
convert=\>["High","float"]  
convert=\>["Low","float"]  
convert=\>["Close","float"]  
convert=\>["Volume","integer"]  
convert=\>["Adj\_close","float"]  
}  
}

output{

```
   elasticsearch{
             hosts=>"localhost"
             port =>"9200"
             }
   }

```

Please advice...

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 31, 2016, 7:04am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/11 "2016-03-31T07:04:48Z")

</div>

If you look in [the documentation](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts) there is an example of how to configure hosts to specify both host and port. As per the same documentation there is no `ports` option. 9200 is also the default port and can therefore usually be omitted.

---

<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, 5:04am UTC](https://discuss.elastic.co/t/clamp-usageerror-unrecognised-option-c/45871/12 "2017-07-06T05:04:35Z")

</div>


