# Loading csv using logstash into Elastic

**URL:** <https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605>\
**Category:** Logstash\
**Created:** [September 23, 2018, 10:19pm UTC](https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605 "2018-09-23T22:19:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barath95](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Barath95](https://discuss.elastic.co/u/Barath95)\
**Post date:** [September 23, 2018, 10:19pm UTC](https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605/1 "2018-09-23T22:19:58Z")

</div>

Hi,

I am using Logstash version 6.4.1 and trying to load a csv file into Elastic via Logstash. I am unable to load the file and keep getting the following error.

[2018-09-23T09:01:16,937][ERROR][logstash.pipeline] Error registering plugin {:pipeline\_id=\>"main", :plugin=\>"\<LogStash::Inputs::File start\_position=\>"beginning", path=\>["C:\\softwares\\logstash-6.4.1\\data\\test.csv"], id=\>"e315cf4128a86616a22c5b516ffdf15ad0472ec28c819380c5b38f0c22520e5c", sincedb\_path=\>"C:\\softwares\\logstash-6.4.1\\data", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_b50149be-87ae-44a8-aac9-068ea0c5e0a5", enable\_metric=\>true, charset=\>"UTF-8"\>, stat\_interval=\>1.0, discover\_interval=\>15, sincedb\_write\_interval=\>15.0, delimiter=\>"\n", close\_older=\>3600.0, mode=\>"tail", file\_completed\_action=\>"delete", sincedb\_clean\_after=\>1209600.0, file\_chunk\_size=\>32768, file\_chunk\_count=\>140737488355327, file\_sort\_by=\>"last\_modified", file\_sort\_direction=\>"asc"\>", :error=\>"The "sincedb\_path" argument must point to a file, received a directory: "C:\softwares\logstash-6.4.1\data"", :thread=\>"#\<Thread:0x340a87 run\>"}  
[2018-09-23T09:01:17,462][ERROR][logstash.pipeline] Pipeline aborted due to error {:pipeline\_id=\>"main", :exception=\>#\<ArgumentError: The "sincedb\_path" argument must point to a file, received a directory: "C:\softwares\logstash-6.4.1\data"\>, :backtrace=\>["C:/softwares/logstash-6.4.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-file-4.1.6/lib/logstash/inputs/file.rb:280:in `register'", "C:/softwares/logstash-6.4.1/logstash-core/lib/logstash/pipeline.rb:242:in`register\_plugin'", "C:/softwares/logstash-6.4.1/logstash-core/lib/logstash/pipeline.rb:253:in `block in register_plugins'", "org/jruby/RubyArray.java:1734:in`each'", "C:/softwares/logstash-6.4.1/logstash-core/lib/logstash/pipeline.rb:253:in `register_plugins'", "C:/softwares/logstash-6.4.1/logstash-core/lib/logstash/pipeline.rb:396:in`start\_inputs'", "C:/softwares/logstash-6.4.1/logstash-core/lib/logstash/pipeline.rb:294:in `start_workers'", "C:/softwares/logstash-6.4.1/logstash-core/lib/logstash/pipeline.rb:200:in`run'", "C:/softwares/logstash-6.4.1/logstash-core/lib/logstash/pipeline.rb:160:in `block in start'"], :thread=\>"#\<Thread:0x340a87 run\>"}  
[2018-09-23T09:01:17,917][ERROR][logstash.agent] Failed to execute action {:id=\>:main, :action\_type=\>LogStash::ConvergeResult::FailedAction, :message=\>"Could not execute action: PipelineAction::Create, action\_result: false", :backtrace=\>nil}

The csv is as below  
col1,col2  
1,2  
3,4

The config file looks like as below  
input {  
file {  
path =\> "C:\softwares\logstash-6.4.1\data\test.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "C:\softwares\logstash-6.4.1\data"   
}  
}

filter {  
csv {  
skip\_header =\> true  
separator =\> ","  
autodetect\_column\_names =\> true  
}  
}

output {  
elasticsearch {  
hosts =\> "[http://DCInnive:9200](http://DCInnive:9200)"  
index =\> "clay\_test"  
}  
}

Kindly request for help.

Thank you.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 24, 2018, 6:24am UTC](https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605/2 "2018-09-24T06:24:07Z")

</div>

> [@Barath95](#):
>
> :error=\>"The "sincedb\_path" argument must point to a file, received a directory: "C:\softwares\logstash-6.4.1\data"

I think this error message is quite clear and explains what is wrong.

---

<div class="post-metadata">

**Author:** ![Barath95](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Barath95](https://discuss.elastic.co/u/Barath95)\
**Post date:** [September 25, 2018, 12:42am UTC](https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605/3 "2018-09-25T00:42:31Z")

</div>

Hi Christian,

Thank you for the help. I tried pointing to a blank file. The error stopped but I never got a success message. The cmd never stopped. I waited a while and then killed the process.

I am sorry, if it is a basic question. Little new to the area and I didn't find how exactly I could resolve the issue.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 25, 2018, 5:17am UTC](https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605/4 "2018-09-25T05:17:09Z")

</div>

If you are new to Logstash I would recommend going through [this blog post](https://www.elastic.co/blog/a-practical-introduction-to-logstash), which provides an introduction to how to work with Logstash.

---

<div class="post-metadata">

**Author:** ![Barath95](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Barath95](https://discuss.elastic.co/u/Barath95)\
**Post date:** [September 25, 2018, 3:14pm UTC](https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605/5 "2018-09-25T15:14:28Z")

</div>

Thank you. That would surely help. I was trying to do the sample file load as given in the blog but I never got the output. It always happens when I try loading a file.  
Below is where it gets struck.  
logstash -f logstash-test.config  
Sending Logstash logs to C:/softwares/logstash-6.4.1/logs which is now configured via log4j2.properties  
[2018-09-25T10:50:02,958][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2018-09-25T10:50:03,280][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"6.4.1"}  
[2018-09-25T10:50:04,909][INFO][logstash.pipeline] Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>8, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50}  
[2018-09-25T10:50:05,368][INFO][logstash.pipeline] Pipeline started successfully {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x614af9 sleep\>"}  
[2018-09-25T10:50:05,408][INFO][filewatch.observingtail] START, creating Discoverer, Watch with file and sincedb collections  
[2018-09-25T10:50:05,408][INFO][logstash.agent] Pipelines running {:count=\>1, :running\_pipelines=\>[:main], :non\_running\_pipelines=\>[]}  
[2018-09-25T10:50:05,650][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}

There is basically no response after this. Below is the config file I used.

input {  
file {  
path =\> "C:\softwares\logstash-6.4.1\data\sample.log"  
start\_position =\> "beginning"  
sincedb\_path =\> "nul"   
}  
}

filter {  
}

output {  
stdout{  
codec =\> rubydebug  
}  
}

The file "sample.log" had a welcome message.

Kindly request your help.

---

<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 23, 2018, 3:14pm UTC](https://discuss.elastic.co/t/loading-csv-using-logstash-into-elastic/149605/6 "2018-10-23T15:14:28Z")

</div>

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