# Logstash running code

**URL:** <https://discuss.elastic.co/t/logstash-running-code/329408>\
**Category:** Logstash\
**Created:** [April 5, 2023, 9:39am UTC](https://discuss.elastic.co/t/logstash-running-code/329408 "2023-04-05T09:39:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sks](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@sks](https://discuss.elastic.co/u/sks)\
**Post date:** [April 5, 2023, 9:39am UTC](https://discuss.elastic.co/t/logstash-running-code/329408/1 "2023-04-05T09:39:13Z")

</div>

Hyy,  
I am new to Elasticsearch . I am trying to send logfile from logstash to elasticsearch .  
for checking purspose i am running this config file as below  
vi logstash-simple.conf  
input { stdin { } }  
output {  
elasticsearch { host =\> localhost }  
stdout { codec =\> rubydebug }  
}

and for running i am using the command

/usr/share/logstash$ sudo bin/logstash -f logstash-simple.conf

but it is not running , i tried every option still it is showing error as below

WARN ] 2023-04-05 20:21:30.472 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[INFO] 2023-04-05 20:21:31.054 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=\>9600, :ssl\_enabled=\>false}  
[INFO] 2023-04-05 20:21:31.363 [Converge PipelineAction::Create] Reflections - Reflections took 145 ms to scan 1 urls, producing 127 keys and 444 values  
[ERROR] 2023-04-05 20:21:32.287 [Converge PipelineAction::Create] elasticsearch - Unknown setting 'host' for elasticsearch  
[ERROR] 2023-04-05 20:21:32.293 [Converge PipelineAction::Create] agent - Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"Java::JavaLang::IllegalStateException", :message=\>"Unable to configure plugins: (ConfigurationError) Something is wrong with your configuration.", :backtrace=\>["org.logstash.config.ir.CompiledPipeline.(CompiledPipeline.java:120)", "org.logstash.execution.AbstractPipelineExt.initialize(AbstractPipelineExt.java:181)", "org.logstash.execution.AbstractPipelineExt$INVOKER$i$initialize.call(AbstractPipelineExt$INVOKER$i$initialize.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:846)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1229)", "org.jruby.ir.instructions.InstanceSuperInstr.interpret(InstanceSuperInstr.java:131)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET\_METHOD(MixedModeIRMethod.java:128)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)", "org.jruby.RubyClass.newInstance(RubyClass.java:911)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87)", "org.jruby.ir.instructions.CallBase.interpret(CallBase.java:549)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)", "org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET\_METHOD(MixedModeIRMethod.java:238)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:226)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:393)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:206)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)", "org.jruby.ir.interpreter.Interpreter.INTERPRET\_BLOCK(Interpreter.java:116)", "org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:66)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)", "org.jruby.runtime.Block.call(Block.java:143)", "org.jruby.RubyProc.call(RubyProc.java:309)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:107)", "java.base/java.lang.Thread.run(Thread.java:833)"]}  
[INFO] 2023-04-05 20:21:32.305 [LogStash::Runner] runner - Logstash shut down.

pls help

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [April 5, 2023, 12:22pm UTC](https://discuss.elastic.co/t/logstash-running-code/329408/2 "2023-04-05T12:22:26Z")

</div>

`[ERROR] 2023-04-05 20:21:32.287 [Converge PipelineAction::Create] elasticsearch - Unknown setting 'host' for elasticsearch`

```auto
elasticsearch { host => localhost }

```

The error you are seeing is saying you are trying to use a setting called `host` and it doesn't exist so it doesn't know what you want to do and shuts down. The correct setting name is `hosts` as you can find in the [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts).

Try the below.

```auto
input { stdin { } }
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 7, 2023, 5:18am UTC](https://discuss.elastic.co/t/logstash-running-code/329408/4 "2023-05-07T05:18:26Z")

</div>

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