Import csv file to elastic search


(Ankur Singla) #1

I am trying to ulpoad csv file from logstash to my elastic cloud cluster using below config

input {
stdin {
type => "stdin-type"
}
file {
path => ["/pipelines/Data.csv"]
start_position => "beginning"
}
}

filter {
csv {
columns => columns => ["Branch","State","Category","Sub Category","Month","Date"]
}
}

output {

elasticsearch {
     hosts => "https://f8f0fdbb28d6340678149e5f.us-east-1.aws.found.io:9243"
     index => "datanew"
	 user => elastic
     password => password
  }

}

but i am getting ConfigurationError

LogStash::ConfigurationError", :message=>"Expected one of #, {, ", ', } at line 13


(Magnus B├Ąck) #2

You have one "columns =>" too many.


(Ankur Singla) #3

thanks.
Is there any support for defining mapping of file columns to index field?


(Krunal Kalaria) #4

in filter you write 2 times columns you write only this

filter { csv { columns => [" your columns "] } }


(system) #5

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