# Getting error while importing csv file to logstash

**URL:** <https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954>\
**Category:** Logstash\
**Created:** [October 5, 2021, 5:34pm UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954 "2021-10-05T17:34:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSirurmath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssirurmath/32/78403_2.png) [@SSirurmath](https://discuss.elastic.co/u/SSirurmath)\
**Post date:** [October 5, 2021, 5:34pm UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/1 "2021-10-05T17:34:06Z")

</div>

[2021-10-05T16:59:04,940][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 5, column 17 (byte 95) after input {\n\tFile {\n\tpath =\> "/var/lib/logstash/report1633160321384.csv"\n\t }\n\tstart\_position ", :backtrace=\>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:187:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:52:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:391:in `block in converge\_state'"]}  
[2021-10-05T16:59:05,057][INFO][logstash.runner] Logstash shut down.  
[2021-10-05T16:59:05,069][FATAL][org.logstash.Logstash] Logstash stopped processing because of an error: (SystemExit) exit  
org.jruby.exceptions.SystemExit: (SystemExit) exit  
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.19.0.jar:?]  
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.19.0.jar:?]  
at usr.share.logstash.lib.bootstrap.environment.(/usr/share/logstash/lib/bootstrap/environment.rb:94) ~[?:?]

below is the config file

input {  
file {  
path =\> "/var/lib/logstash/report1.csv"  
start\_position =\> "begining"  
sincedb-path =\> "/dev/null"  
}  
}  
filter {  
csv{  
separator =\> "."  
skip\_header =\> "true"  
colomns =\> ["event\_name", event\_type\_type","reporting\_ip","event\_receive\_time"]  
}  
}  
output {  
Elasticsearch {  
hosts =\> "[https://localhosts:9200](https://localhosts:9200)"  
index =\> "demo-csv"  
}  
stdout{}

---

<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 5, 2021, 6:49pm UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/2 "2021-10-05T18:49:22Z")

</div>

> [@SSirurmath](#):
>
> start\_position =begining

Change = to =\>

---

<div class="post-metadata">

**Author:** ![SSirurmath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssirurmath/32/78403_2.png) [@SSirurmath](https://discuss.elastic.co/u/SSirurmath)\
**Post date:** [October 6, 2021, 4:30am UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/3 "2021-10-06T04:30:35Z")

</div>

Its is same as you mentioned.

---

<div class="post-metadata">

**Author:** ![SSirurmath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssirurmath/32/78403_2.png) [@SSirurmath](https://discuss.elastic.co/u/SSirurmath)\
**Post date:** [October 6, 2021, 4:50am UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/4 "2021-10-06T04:50:50Z")

</div>

[quote="SSirurmath, post:1, topic:285954"]  
input {  
file {  
path =\> "/var/lib/logstash/report1.csv"  
start\_position =\> "begining"  
sincedb-path =\> "/dev/null"  
}  
}  
filter {  
csv{  
separator =\> "."  
skip\_header =\> "true"  
colomns =\> ["event\_name", event\_type\_type","reporting\_ip","event\_receive\_time"]  
}  
}  
output {  
Elasticsearch {  
hosts =\> "[https://localhosts:9200](https://localhosts:9200)"  
index =\> "demo-csv"  
}  
stdout{}

---

<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 6, 2021, 2:59pm UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/5 "2021-10-06T14:59:37Z")

</div>

You need to show us the configuration and the error that you get with that configuration. Currently they do not match.

---

<div class="post-metadata">

**Author:** ![SSirurmath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssirurmath/32/78403_2.png) [@SSirurmath](https://discuss.elastic.co/u/SSirurmath)\
**Post date:** [October 7, 2021, 5:32am UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/6 "2021-10-07T05:32:17Z")

</div>

> [@SSirurmath](#):
>
> Below is the config,
> 
> input {  
> file {  
> path =\> "/var/lib/logstash/report1.csv"  
> start\_position =\> "begining"  
> sincedb-path =\> "/dev/null"  
> }  
> }  
> filter {  
> csv{  
> separator =\> "."  
> skip\_header =\> "true"  
> colomns =\> ["event\_name", event\_type\_type","reporting\_ip","event\_receive\_time"]  
> }  
> }  
> output {  
> Elasticsearch {  
> hosts =\> "[https://localhosts:9200](https://localhosts:9200)"  
> index =\> "demo-csv"  
> }  
> stdout{}

Below is the error,

[2021-10-05T16:59:04,940][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 5, column 17 (byte 95) after input {\n\tFile {\n\tpath =\> "/var/lib/logstash/report1633160321384.csv"\n\t }\n\tstart\_position ", :backtrace=\>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:187:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:72:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:52:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:391:in `block in converge\_state'"]}  
[2021-10-05T16:59:05,057][INFO][logstash.runner] Logstash shut down.  
[2021-10-05T16:59:05,069][FATAL][org.logstash.Logstash] Logstash stopped processing because of an error: (SystemExit) exit  
org.jruby.exceptions.SystemExit: (SystemExit) exit  
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.19.0.jar:?]  
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.19.0.jar:?]  
at usr.share.logstash.lib.bootstrap.environment.(/usr/share/logstash/lib/bootstrap/environment.rb:94) ~[?:?]

---

<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 7, 2021, 3:56pm UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/7 "2021-10-07T15:56:27Z")

</div>

Again, the configuration and the error message do not match. The error message shows that you have a } immediately after the `path` option on the file input, which means logstash would interpret start\_position as an input plugin name, and expect it to be followed by {, not =\>

---

<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:** [November 4, 2021, 3:57pm UTC](https://discuss.elastic.co/t/getting-error-while-importing-csv-file-to-logstash/285954/8 "2021-11-04T15:57:14Z")

</div>

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