I converted a csv file to a json file. How to read this file with logstash and put in elasticsearch. I don't see any error. My json file looks like this:
[{"LOR": "LOR ", "CGPA": "CGPA", "TOEFL Score": "TOEFL Score", "GRE Score": "GRE Score", "Serial No": "Serial No", "SOP": "SOP", "Chance of Admit": "Chance of Admit ", "University Rating": "University Rating", "Research": "Research"}, {"LOR": "4.5", "CGPA": "9.65", "TOEFL Score": "118", "GRE Score": "337", "Serial No": "1", "SOP": "4.5", "Chance of Admit": "0.82", "University Rating": "4", "Research": "1"}, {"LOR": "4.5", "CGPA": "8.87", "TOEFL Score": "107", "GRE Score": "324", "Serial No": "2", "SOP": "4", "Chance of Admit": "0.76", "University Rating": "4", "Research": "1"},
There is more.
my logstash config file is like this:
`input {
file{
codec =>json
path => "/home/abhinavkumar.gurung/Applications/csv/devian/data/file.json"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
json{
source =>"message"
}
mutate{
remove_field => ["@version","host"]
}
}
output {
elasticsearch {
hosts => ["elasticsearch:9200"]
user => elastic
password => changeme
index => "markers"
}
stdout {
codec => rubydebug
}
}`