Hi,
There seems to be an error in my ruby script, but I have no idea what it is, as the log is showing nothing... Please help!
part of config file:
date {
match => ["date", "yyyy-MM-dd HH:mm:ss.SSS"]
}
grok {
match => ["message", "checkName: %{WORD:checkName}, execution time: %{NUMBER:execution_duration}, path: %{NOTSPACE:step_path}"]
}
if [execution_duration] {
mutate {
convert => {"execution_duration" => "integer"}
copy => {"@timestamp" => "end_time"}
}
ruby {
code => 'event.set("end_time", LogStash::Timestamp.new(Time.at(event.get("end_time").to_f+(event.get("execution_duration").to_f/1000.00))))'
}
}
Error log:
[2018-08-20T10:16:46,779][INFO ][logstash.agent ] Pipelines running {:count=>1, :pipelines=>["main"]}
[2018-08-20T10:17:02,759][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:02,770][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:02,781][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:02,783][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:02,845][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:02,851][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:02,863][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:02,965][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,116][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,127][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,143][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,145][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,192][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,198][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,215][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,223][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,245][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,249][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,273][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,277][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,283][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,288][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,292][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,297][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,297][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,304][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,324][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,329][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,341][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,351][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,396][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,441][ERROR][logstash.filters.ruby ] Ruby exception occurred:
[2018-08-20T10:17:03,456][ERROR][logstash.outputs.elasticsearch] An unknown error occurred sending a bulk request to Elasticsearch. We will retry indefinitely {:error_message=>"", :error_class=>"LogStash::Json::GeneratorError", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/json.rb:28:in `jruby_dump'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.3-java/lib/logstash/outputs/elasticsearch/http_client.rb:115:in `block in bulk'", "org/jruby/RubyArray.java:2486:in `map'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.3-java/lib/logstash/outputs/elasticsearch/http_client.rb:115:in `block in bulk'", "org/jruby/RubyArray.java:1734:in `each'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.3-java/lib/logstash/outputs/elasticsearch/http_client.rb:113:in `bulk'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.3-java/lib/logstash/outputs/elasticsearch/common.rb:232:in `safe_bulk'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.3-java/lib/logstash/outputs/elasticsearch/common.rb:118:in `submit'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.3-java/lib/logstash/outputs/elasticsearch/common.rb:86:in `retrying_submit'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.3-java/lib/logstash/outputs/elasticsearch/common.rb:34:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:13:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:49:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:479:in `block in output_batch'", "org/jruby/RubyHash.java:1343:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:478:in `output_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:430:in `worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:385:in `block in start_workers'"]}