How to read log files using Logstash , where my logs are generated using bunyan/winston in node in the following format ? I am getting this error

LOGS TO BE READ BY LOGSTASH IN THE FOLLOWING FORMAT in a log file:

{"name":"portal-api","hostname":"vid","pid":10348,"level":30,"msg":"Start fetching","time":"2019-06-28T07:19:49.364Z","v":0}
{"name":"portal-api","hostname":"vid","pid":10348,"level":30,"msg":"Query executed","time":"2019-06-28T07:19:49.368Z","v":0}

ERROR WHILE RUNNING : logstash-7.2.0\bin>logstash -f logstash-app.conf

ERROR :

Thread.exclusive is deprecated, use Thread::Mutex
Sending Logstash logs to C:/Users/akshatb/Documents/softwares/logstash-7.2.0/logs which is now configured via log4j2.properties
[2019-06-28T13:56:19,691][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-06-28T13:56:19,703][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.2.0"}
[2019-06-28T13:56:24,649][ERROR][logstash.outputs.elasticsearch] Unknown setting 'host' for elasticsearch
[2019-06-28T13:56:24,658][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Something is wrong with your configuration.", :backtrace=>["C:/Users/akshatb/Documents/softwares/logstash-7.2.0/logstash-core/lib/logstash/config/mixin.rb:87:in config_init'", "C:/Users/akshatb/Documents/softwares/logstash-7.2.0/logstash-core/lib/logstash/outputs/base.rb:60:ininitialize'", "org/logstash/config/ir/compiler/OutputStrategyExt.java:232:in initialize'", "org/logstash/config/ir/compiler/OutputDelegatorExt.java:48:ininitialize'", "org/logstash/config/ir/compiler/OutputDelegatorExt.java:30:in initialize'", "org/logstash/plugins/PluginFactoryExt.java:242:inplugin'", "org/logstash/plugins/PluginFactoryExt.java:140:in buildOutput'", "org/logstash/execution/JavaBasePipelineExt.java:50:ininitialize'", "C:/Users/akshatb/Documents/softwares/logstash-7.2.0/logstash-core/lib/logstash/java_pipeline.rb:24:in initialize'", "C:/Users/akshatb/Documents/softwares/logstash-7.2.0/logstash-core/lib/logstash/pipeline_action/create.rb:36:inexecute'", "C:/Users/akshatb/Documents/softwares/logstash-7.2.0/logstash-core/lib/logstash/agent.rb:325:in `block in converge_state'"]}
[2019-06-28T13:56:24,927][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2019-06-28T13:56:29,801][INFO ][logstash.runner ] Logstash shut down.

It should be hosts, not host.

Hey Badger !! can you guide me , how to proceed with this problem .
I pasted the error what I received .

As I said, the elasticsearch output has a hosts option, not a host option.

1 Like

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