Hi,
I have a file having Json data. I have an index "company" and document-type as "employee" present in my local elasticsearch server. I am unable to index the data from the file and send it to elasticsearch server.
config file name: logstash_test.conf
content in config file:
input{
file {
path => "/opt/test.log"
type => "json"
start_position => "beginning"
codec => "json"
}
}
output {
elasticsearch { hosts => ["localhost:9200"]
index => "company"
document_type => "employee"
document_id => "%{@timestamp}"
}
stdout { codec => rubydebug }
}
My json data file content is:
{{"first_name":"r1","last_name":"j1","dob":"1922-05-09"},
{"first_name":"r2","last_name":"j2","dob":"1944-05-09"}}
Please help me out in resolving this issue.