[2020-05-28T07:16:16,770][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \t\r\n], "#", "{" at line 2, column 13 (byte 22) after input {\r\n uri ", :backtrace=>["C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:58:in compile_imperative'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:66:in compile_graph'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:28:in block in compile_sources'", "org/jruby/RubyArray.java:2577:in map'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/compiler.rb:27:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:181:in initialize'", "org/logstash/execution/JavaBasePipelineExt.java:67:in initialize'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/java_pipeline.rb:43:in initialize'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/pipeline_action/create.rb:52:in execute'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/agent.rb:342:in block in converge_state'"]}
[2020-05-28T07:16:17,473][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2020-05-28T07:16:22,380][INFO ][logstash.runner ] Logstash shut down.
Remembering that I performed the installation by command:
C:\Users\Administrator\Documents\Elastic\versao7.7\logstash-7.7.0\bin\logstash-plugin install logstash-output-mongodb
Thanks for the answer!
I made the changes and presented the following error:
Could you help me?
[2020-05-28T09:33:05,831][ERROR][logstash.agent ] An exception happened when converging configuration {:exception=>LogStash::Error, :message=>"Don't know how to handle Java::JavaLang::IllegalStateException for PipelineAction::Create<main>", :backtrace=>["org/logstash/execution/ConvergeResultExt.java:129:in create'", "org/logstash/execution/ConvergeResultExt.java:57:in add'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/agent.rb:355:in block in converge_state'"]} [2020-05-28T09:33:05,908][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<LogStash::Error: Don't know how to handle Java::JavaLang::IllegalStateExceptionforPipelineAction::Create>, :backtrace=>["org/logstash/execution/ConvergeResultExt.java:129:in create'", "org/logstash/execution/ConvergeResultExt.java:57:in add'", "C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/agent.rb:355:in block in converge_state'"]}
[2020-05-28T09:33:05,967][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
warning: thread "Api Webserver" terminated with exception (report_on_exception is true):
NameError: uninitialized constant Rack::Builder
Did you mean? Rack::Builder
const_missing at org/jruby/RubyModule.java:3760
app at C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/api/rack_app.rb:97
start_webserver at C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/webserver.rb:99
run at C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/webserver.rb:60
each at org/jruby/RubyRange.java:526
each_with_index at org/jruby/RubyEnumerable.java:1258
run at C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/webserver.rb:55
start_webserver at C:/Users/Administrator/Documents/Elastic/versao7.7/logstash-7.7.0/logstash-core/lib/logstash/agent.rb:393
You seem to have loaded a version of the rack library that does not have a Builder class. I do not know much about dependency management in Ruby but I would have expected the system to detect that your rack is incompatible with your mongodb input.
I changed the version to the previous one and used the commands
Validating logstash-output-mongodb
Installing logstash-output-mongodb
Installation successful
Validating logstash-input-mongodb
Installing logstash-input-mongodb
Installation successful
And I ran my conf file and a different error appeared.
2020-05-28T10:29:06,578][INFO ][logstash.outputs.elasticsearch][main] Attempting to install template {:manage_template=>{"index_patterns"=>"logstash-*", "version"=>60001, "settings"=>{"index.refresh_interval"=>"5s", "number_of_shards"=>1}, "mappings"=>{"dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword", "ignore_above"=>256}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date"}, "@version"=>{"type"=>"keyword"}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}
D, [2020-05-28T10:29:09.206000 #6008] DEBUG -- : MONGODB | EVENT: #<TopologyOpening topology=Unknown[]>
D, [2020-05-28T10:29:09.252000 #6008] DEBUG -- : MONGODB | Topology type 'unknown' initializing.
D, [2020-05-28T10:29:09.494000 #6008] DEBUG -- : MONGODB | EVENT: #<TopologyChanged prev=Unknown[] new=Unknown[localhost:27017]>
D, [2020-05-28T10:29:09.565000 #6008] DEBUG -- : MONGODB | Topology type 'Unknown' changed to type 'Unknown'.
D, [2020-05-28T10:29:09.630000 #6008] DEBUG -- : MONGODB | EVENT: #<ServerOpening address=localhost:27017 topology=Unknown[localhost:27017]>
D, [2020-05-28T10:29:09.814000 #6008] DEBUG -- : MONGODB | Server localhost:27017 initializing.
D, [2020-05-28T10:29:09.895000 #6008] DEBUG -- : MONGODB | Waiting for up to 29.79 seconds for servers to be scanned: #<Cluster topology=Unknown[localhost:27017] servers=[#<Server address=localhost:27017 UNKNOWN>]>
D, [2020-05-28T10:29:10.536000 #6008] DEBUG -- : MONGODB | Error running ismaster on localhost:27017: Mongo::Error::SocketError: OpenSSL::SSL::SSLError: An existing connection was forcibly closed by the remote host (for 127.0.0.1:27017 (localhost:27017, TLS)) (MongoDB may not be configured with SSL support):
C:/Users/Administrator/Documents/Elastic/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/mongo-2.12.1/lib/mongo/socket.rb:343:in `handle_errors'
C:/Users/Administrator/Documents/Elastic/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/mongo-2.12.1/lib/mongo/socket/ssl.rb:56:in `block in connect!'
C:/Users/Administrator/Documents/Elastic/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/mongo-2.12.1/lib/mongo/timeout.rb:43:in `block in timeout'
org/jruby/ext/timeout/Timeout.java:99:in `timeout'
org/jruby/ext/timeout/Timeout.java:75:in `timeout'
C:/Users/Administrator/Documents/Elastic/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/mongo-2.12.1/lib/mongo/timeout.rb:42:in `timeout'
I'm accessing the database normally through Robo 3T and terminal, there is no username and password for testing, do you imagine where this error could be?
In the previous example it was as follows: mongodb://localhost:27017/exemplo? ssl=true
But ssl authorization is not enabled, I removed it and left it without ssl and presented the following error.
[2020-05-28T14:01:38,070][ERROR][logstash.javapipeline ][main] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<Sequel::DatabaseConnectionError: Java::JavaSql::SQLException: path to '/opt/logstash-mongodb/logstash_sqlite.db': 'C:\opt' does not exist>
Log error:
2020-05-28T14:01:35.748-0700 I NETWORK [listener] connection accepted from 127.0.0.1:51183 #16 (7 connections now open)
2020-05-28T14:01:35.844-0700 I NETWORK [conn16] received client metadata from 127.0.0.1:51183 conn16: { driver: { name: "mongo-ruby-driver", version: "2.12.1" }, os: { type: "mswin", name: "mswin32", architecture: "x86_64" }, platform: "2.5.7, java, java1.8" }
2020-05-28T14:01:43.471-0700 I NETWORK [conn16] end connection 127.0.0.1:51183 (6 connections now open)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.