2017-06-16 11 views
1

私はELKスタックを3台のドッカーコンテナでホストマシンubuntu 16.04 で実行しています。問題は "ifconfig"や "netstat - ano "エラーが出る。私logstash.confファイルは次のとおりです。ログ検索のためのコマンドを実行するためのlogstash設定

input { 
 
    exec { 
 
    
 
    command => "netsat -ano" 
 
    codec => "json" 
 
    interval => 5 
 
    } 
 
} 
 
output{ 
 
    elasticsearch { hosts => ["elasticsearch:9200"]} 
 
} 
 
i get this error after entering this command (docker run -h logstash --name logstash --link elasticsearch:elasticsearch -it --rm -v "$PWD":/config-dir logstash -f /config-dir/logstash1.conf)

14:29:30.703 [[main]<exec] ERROR logstash.inputs.exec - Error while running command {:command=>"netsat -ano", :e=>#<IOError: Cannot run program "netsat" (in directory "/"): error=2, No such file or directory>, :backtrace=>["org/jruby/RubyIO.java:4380:in `popen'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-exec-3.1.2/lib/logstash/inputs/exec.rb:76:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-exec-3.1.2/lib/logstash/inputs/exec.rb:75:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-exec-3.1.2/lib/logstash/inputs/exec.rb:40:in `inner_run'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-exec-3.1.2/lib/logstash/inputs/exec.rb:34:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:443:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:436:in `start_input'"]} 

誰もが事前にしてください感謝を助けることができます!

+0

あなたは実際には私はそれは私も – fylie

+0

'と' netstat'をtypo'd/netstat -ano "と表示されていましたが、以下に同じエラーが表示されませんでした – cilzzz

答えて

0

これらのコマンドには、それらのディレクトリが含まれていないLogstashを実行するためのフルパスを指定する必要があります。

input { 
    exec { 
    command => "/bin/netsat -ano" 
    codec => "json" 
    interval => 5 
    } 

}

+0

の下にマークされ、 "ifconfigコマンド" と同じエラーが実際には「/ sbinにあるしようとした間違いだったKNW netstatコマンドであるnetsat' – cilzzz

関連する問題