Clamp::UsageError: Unrecognised option '-c'

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"

             }
   }

Which version of Logstash?

Logstash 2.2.3

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.

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

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

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

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

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.

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 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...

If you look in the documentation 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.