I trying am reading a csv file and index it into elastic. Logstash is giving this error:
[2020-03-15T14:43:02,424][ERROR][logstash.javapipeline ][main] A plugin had an unrecoverable error. Will restart this plugin. Pipeline_id:main Plugin: "beginning", path=>["/Users/shivam/Documents/logstash_example/cars.csv"], id=>"csv_elastic", sincedb_path=>"/dev/null", enable_metric=>true, codec=>"plain_c8e06e64-c1d8-49ea-aa2f-e54c38c96929", 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", exit_after_read=>false> Error: Permission denied - Permission denied Exception: Errno::EACCES Stack: org/jruby/RubyFile.java:1269:in
utime' uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/fileutils.rb:1133:in
block in touch' org/jruby/RubyArray.java:1814:ineach' uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/fileutils.rb:1130:in
touch' /Users/shivam/Workspace/elastic_stack/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-file-4.1.16/lib/filewatch/sincedb_collection.rb:22:ininitialize' /Users/shivam/Workspace/elastic_stack/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-file-4.1.16/lib/filewatch/observing_base.rb:62:in
build_watch_and_dependencies' /Users/shivam/Workspace/elastic_stack/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-file-4.1.16/lib/filewatch/observing_base.rb:56:ininitialize' /Users/shivam/Workspace/elastic_stack/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-file-4.1.16/lib/logstash/inputs/file.rb:341:in
start_processing' /Users/shivam/Workspace/elastic_stack/logstash-7.6.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-file-4.1.16/lib/logstash/inputs/file.rb:346:inrun' /Users/shivam/Workspace/elastic_stack/logstash-7.6.1/logstash-core/lib/logstash/java_pipeline.rb:328:in
inputworker' /Users/shivam/Workspace/elastic_stack/logstash-7.6.1/logstash-core/lib/logstash/java_pipeline.rb:320:in `block in start_input'
Config file is like:
input{
file{
id => "csv_elastic"
path => "/Users/shivam/Documents/logstash_example/cars.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv{
separator => ","
columns => ["Id","Model","Company","Engine"]
}
}
output{
elasticsearch{
hosts => "http://localhost:9200"
index => "cars"
}
stdout{}
}
file permissions for csv file:
-rwxrwxrwx@ 1 shivam staff 85 Mar 15 13:33 cars.csv
-rw-rw-rw-@ 1 shivam staff 347 Mar 15 13:57 logstash-cars.config
tried giving all permission in logstash/logs folder as well.