# Running sample text file thorough logstash

**URL:** <https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821>\
**Category:** Logstash\
**Created:** [October 2, 2020, 4:35pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821 "2020-10-02T16:35:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 2, 2020, 4:35pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/1 "2020-10-02T16:35:00Z")

</div>

This is my sample file

FName,Lname,sal,location  
Suresh,Koganti,6000,Montreal  
Denis,Gallagher,7000,Quebec

and this is my conf file

input {

```
file{

    path => "C:\Users\skkoganti\Documents\log\users.txt"

    start_position => "beginning"

}

```

}

filter {

```
    text{

autodetect_column_names => true

}

```

}

output {

```
stdout {

codec => rubydebug

}

```

}

i am getting the below error.

C:\Users\skkoganti\Documents\log\>logstash -e 'input{stdin{}}output{stdout{}}'  
Sending Logstash logs to C:/ELK/logstash-7.9.1/logstash-7.9.1/logs which is now configured via log4j2.properties  
[2020-10-02T12:25:15,007][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.9.1", "jruby.version"=\>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-10-02T12:25:15,264][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-10-02T12:25:16,063][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of [\t\r\n], "#", "input", "filter", "output" at line 1, column 1 (byte 1)", :backtrace=\>["C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:183:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:69:in `initialize'", "C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/java_pipeline.rb:44:in `initialize'", "C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/pipeline\_action/create.rb:52:in `execute'", "C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/agent.rb:357:in `block in converge\_state'"]}  
[2020-10-02T12:25:16,430][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2020-10-02T12:25:21,506][INFO][logstash.runner] Logstash shut down.  
[2020-10-02T12:25:21,525][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 2, 2020, 4:53pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/2 "2020-10-02T16:53:42Z")

</div>

> [@sukumar.koganti](#):
>
> -e 'input{stdin{}}output{stdout{}}'

If you specify -e it will not use the configuration file.

I cannot imagine why you would get that error with that command line.

Do not use backslash in the path option of a file input, it is treated as an escape. Use / instead.

---

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 2, 2020, 5:24pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/3 "2020-10-02T17:24:05Z")

</div>

Thanks for quick reply,

i am getting the same error again.

C:\Users\skkoganti\Documents\log\>logstash -f koganti.conf  
Sending Logstash logs to C:/ELK/logstash-7.9.1/logstash-7.9.1/logs which is now configured via log4j2.properties  
[2020-10-02T13:22:58,927][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.9.1", "jruby.version"=\>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-10-02T13:22:59,185][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-10-02T13:22:59,853][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=\>"C:/Users/skkoganti/Documents/log/koganti.conf"}  
[2020-10-02T13:22:59,872][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.  
[2020-10-02T13:23:00,238][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2020-10-02T13:23:05,116][INFO][logstash.runner] Logstash shut down.  
[2020-10-02T13:23:05,139][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 2, 2020, 5:27pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/4 "2020-10-02T17:27:43Z")

</div>

> [@sukumar.koganti](#):
>
> No config files found in path {:path=\>"C:/Users/skkoganti/Documents/log/koganti.conf"}

No, that is a different message. It is not finding the file.

---

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 2, 2020, 5:58pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/5 "2020-10-02T17:58:02Z")

</div>

I am getting the different error this time

C:\Users\skkoganti\Documents\log\>logstash -f koganti.conf  
Sending Logstash logs to C:/ELK/logstash-7.9.1/logstash-7.9.1/logs which is now configured via log4j2.properties  
[2020-10-02T13:57:06,266][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.9.1", "jruby.version"=\>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0\_261-b12 +indy +jit [mswin32-x86\_64]"}  
[2020-10-02T13:57:06,534][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2020-10-02T13:57:08,496][INFO][org.reflections.Reflections] Reflections took 44 ms to scan 1 urls, producing 22 keys and 45 values  
[2020-10-02T13:57:09,320][ERROR][logstash.plugins.registry] Tried to load a plugin's code, but failed. {:exception=\>#\<LoadError: no such file to load -- logstash/filters/txt\>, :path=\>"logstash/filters/txt", :type=\>"filter", :name=\>"txt"}  
[2020-10-02T13:57:09,337][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"Java::JavaLang::IllegalStateException", :message=\>"Unable to configure plugins: (PluginLoadingError) Couldn't find any filter plugin named 'txt'. Are you sure this is correct? Trying to load the txt filter plugin resulted in this error: no such file to load -- logstash/filters/txt", :backtrace=\>["org.logstash.config.ir.CompiledPipeline.(CompiledPipeline.java:119)", "org.logstash.execution.JavaBasePipelineExt.initialize(JavaBasePipelineExt.java:82)", "org.logstash.execution.JavaBasePipelineExt$INVOKER$i$1$0$initialize.call(JavaBasePipelineExt$INVOKER$i$1$0$initialize.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:837)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1169)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:1156)", "org.jruby.ir.targets.InstanceSuperInvokeSite.invoke(InstanceSuperInvokeSite.java:39)", "C\_3a\_.ELK.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_core.lib.logstash.java\_pipeline.RUBY$method$initialize$0(C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/java\_pipeline.rb:44)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:86)", "org.jruby.RubyClass.newInstance(RubyClass.java:939)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)", "C\_3a\_.ELK.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_core.lib.logstash.pipeline\_action.create.RUBY$method$execute$0(C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/pipeline\_action/create.rb:52)", "C\_3a\_.ELK.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_core.lib.logstash.pipeline\_action.create.RUBY$method$execute$0$ **VARARGS** (C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/pipeline\_action/create.rb)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)", "org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)", "C\_3a\_.ELK.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_7\_dot\_9\_dot\_1.logstash\_minus\_core.lib.logstash.agent.RUBY$block$converge\_state$2(C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/agent.rb:357)", "org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:138)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:52)", "org.jruby.runtime.Block.call(Block.java:139)", "org.jruby.RubyProc.call(RubyProc.java:318)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105)", "java.lang.Thread.run(Unknown Source)"]}  
warning: thread "Converge PipelineAction::Create" terminated with exception (report\_on\_exception is true):  
LogStash::Error: Don't know how to handle `Java::JavaLang::IllegalStateException` for `PipelineAction::Create<main>`  
create at org/logstash/execution/ConvergeResultExt.java:129  
add at org/logstash/execution/ConvergeResultExt.java:57  
converge\_state at C:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/agent.rb:370  
[2020-10-02T13:57:09,349][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>`"}  
[2020-10-02T13:57:09,388][FATAL][logstash.runner] An unexpected error occurred! {:error=\>#\<LogStash::Error: 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:/ELK/logstash-7.9.1/logstash-7.9.1/logstash-core/lib/logstash/agent.rb:370:in `block in converge\_state'"]}  
[2020-10-02T13:57:09,410][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 2, 2020, 6:36pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/6 "2020-10-02T18:36:06Z")

</div>

> [@sukumar.koganti](#):
>
> LoadError: no such file to load -- logstash/filters/txt\>, :path=\>"logstash/filters/txt", :type=\>"filter", :name=\>"txt"

You are loading a non-existent filter. In your first post you had

```
filter {
    text{
        autodetect_column_names => true
    }
}

```

Did you mean that to be csv?

---

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 2, 2020, 6:48pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/7 "2020-10-02T18:48:22Z")

</div>

No, i am actually running the txt file. Later i changed on conf file as per my requirement.

input {

```
file{

    path => "C:/Users/skkoganti/Documents/log/users.txt"

    start_position => "beginning"

}

```

}

filter {

```
    txt{

        separator => ","

        columns => ["FName","Lname","sal","location"]

        autodetect_column_names => true

}

mutate {convert => ["FName", "string"]}

mutate {convert => ["Lname", "string"]}  

mutate {convert => ["sal", "integer"]} 

mutate {convert => ["location", "string"]} 

```

}

output {

```
stdout {

codec => rubydebug

}

```

}

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 2, 2020, 7:01pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/8 "2020-10-02T19:01:18Z")

</div>

> [@sukumar.koganti](#):
>
> filter {
> 
> ```auto
> txt{
> 
> ```

There is no such thing as a txt filter. It looks like you are trying to configure a csv filter. The name of the filter is based on its functionality. It has nothing to do with the name of the file that you are reading.

---

<div class="post-metadata">

**Author:** ![sukumar.koganti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukumar.koganti/32/74111_2.png) [@sukumar.koganti](https://discuss.elastic.co/u/sukumar.koganti)\
**Post date:** [October 2, 2020, 9:33pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/9 "2020-10-02T21:33:46Z")

</div>

Thanks Badger,

I don't know how to read sample text file but i want to read my log files which my ETL tool is generating log files. at least i need to test txt file through logstash.

Please help me on this or if you sample conf file please share me.

Thanks,  
Suresh Koganti.

---

<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:** [October 30, 2020, 9:33pm UTC](https://discuss.elastic.co/t/running-sample-text-file-thorough-logstash/250821/10 "2020-10-30T21:33:57Z")

</div>

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