Logstashのエラーについて

Logstashからnginxのアクセスログを別のサーバで動いているElasticsearchに送りたいのですがエラーが出て困っています

[2019-07-22T12:24:18,898][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<SocketError: initialize: name or service not known>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:124:in initialize'", "org/jruby/RubyIO.java:876:in new'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/binder.rb:234:in add_tcp_listener'", "(eval):2:in add_tcp_listener'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:88:in start_webserver'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:44:in block in run'", "org/jruby/RubyRange.java:511:in each'", "org/jruby/RubyEnumerable.java:1194:in each_with_index'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:39:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:376:in block in start_webserver'"]}
[2019-07-22T12:24:18,922][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
[2019-07-22T12:24:40,752][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.2.0"}
[2019-07-22T12:24:42,314][ERROR][logstash.filters.mutate ] Unknown setting 'replate' for mutate
[2019-07-22T12:24:42,321][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:nginx, :exception=>"LogStash::ConfigurationError", :message=>"Something is wrong with your configuration.", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:87:in config_init'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:126:in initialize'", "org/logstash/plugins/PluginFactoryExt.java:81:in filter_delegator'", "org/logstash/plugins/PluginFactoryExt.java:251:in plugin'", "org/logstash/execution/JavaBasePipelineExt.java:50:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:24:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:325:in block in converge_state'"]}
[2019-07-22T12:24:42,543][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<SocketError: initialize: name or service not known>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:124:in initialize'", "org/jruby/RubyIO.java:876:in new'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/binder.rb:234:in add_tcp_listener'", "(eval):2:in add_tcp_listener'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:88:in start_webserver'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:44:in block in run'", "org/jruby/RubyRange.java:511:in each'", "org/jruby/RubyEnumerable.java:1194:in each_with_index'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:39:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:376:in block in start_webserver'"]}
[2019-07-22T12:24:42,577][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
[2019-07-22T12:24:54,857][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.2.0"}
[2019-07-22T12:24:56,399][ERROR][logstash.filters.mutate ] Unknown setting 'replate' for mutate
[2019-07-22T12:24:56,406][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:nginx, :exception=>"LogStash::ConfigurationError", :message=>"Something is wrong with your configuration.", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:87:in config_init'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:126:in initialize'", "org/logstash/plugins/PluginFactoryExt.java:81:in filter_delegator'", "org/logstash/plugins/PluginFactoryExt.java:251:in plugin'", "org/logstash/execution/JavaBasePipelineExt.java:50:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:24:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:325:in block in converge_state'"]}
[2019-07-22T12:24:56,600][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<SocketError: initialize: name or service not known>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:124:in initialize'", "org/jruby/RubyIO.java:876:in new'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/binder.rb:234:in add_tcp_listener'", "(eval):2:in add_tcp_listener'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:88:in start_webserver'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:44:in block in run'", "org/jruby/RubyRange.java:511:in each'", "org/jruby/RubyEnumerable.java:1194:in each_with_index'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:39:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:376:in block in start_webserver'"]}
[2019-07-22T12:24:56,625][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

/etc/logstash/pipelines.yml
.- pipeline.id: nginx
pipeline.batch.size: 125
path.config: "/etc/logstash/conf.d/nginx.conf"
pipeline.workers: 1

/etc/logstash/conf.d/nginx.conf

input {
file {
path => "/var/log/nginx/access.log"
start_position => beginning
}
}
filter {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
date {
match => [ "timestamp", "dd/MM/yyyy:HH:mm:ss Z"]
locale => "en"
}
mutate {
replate => { "type" => "nginx_log" }
}
}
output {
elasticsearch {
hosts => ["192.168.0.11:9200", "192.168.0.12:9200", "192.168.0.13:9200", "192.168.0.14:9200", "192.168.0.15:9200"]
index => "nginx_%{+YYYYMMdd}"
}
}

どなたかわかる方よろしくお願いします。

こんにちわ

提示されているエラーの内容を見ますと、原因が書かれていました。

[2019-07-22T12:24:56,399][ERROR][logstash.filters.mutate ] Unknown setting 'replate' for mutate

replaceとすべきところ、replateとタイプミスしているのが原因です。
replareと正しく書いて再度実行してみてください。

mutate {
    replace => { "type" => "nginx_log" }
}

まずログを見てもらえれば、たいていのことは解決できるのではと思います。

ありがとうございます完全に見落としてました:sob:
そこのエラーは治ったんですが

[2019-07-22T14:14:58,133][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<SocketError: initialize: name or service not known>, :backtrace=>["org/jruby/ext/socket/RubyTCPServer.java:124:in initialize'", "org/jruby/RubyIO.java:876:in new'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-2.16.0-java/lib/puma/binder.rb:234:in add_tcp_listener'", "(eval):2:in add_tcp_listener'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:88:in start_webserver'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:44:in block in run'", "org/jruby/RubyRange.java:511:in each'", "org/jruby/RubyEnumerable.java:1194:in each_with_index'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:39:in run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:376:in block in start_webserver'"]}
[2019-07-22T14:14:58,249][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

ここがまったくわかりません:sob:

logstash.ymlの中身はどのようになっていますか?

http_hostに名前解決できない(つまり 0.0.0.0や127.0.0.1でない)値を設定してみたところ同じエラーが出ました。
http_hostとして、xgar.sdd.com と出鱈目な値を入れて実行した結果が以下です。

agent.rbの376行目は、webserver.runになっており、ホスト、ポートなどの設定のどこかに誤りがあるため、webserverが起動できてなくてエラーになっているのではと考えます。
そのため、logstash.ymlを確認したいのです。

def start_webserver
    @webserver_control_lock.synchronize do
      options = {:http_host => @http_host, :http_ports => @http_port, :http_environment => @http_environment }
      @webserver = LogStash::WebServer.new(@logger, self, options)
      @webserver_thread = Thread.new(@webserver) do |webserver|
        LogStash::Util.set_thread_name("Api Webserver")
        webserver.run
      end
    end
  end

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