Hi,
I am trying to injest data from logstash to elastic, and have this array of json objects, such that each element in the array is a doc in elasticsearch, with the key name as the keys in the json.
[
{"name": "bouza", "age": 40, "type": "customer", "credit": "Nil", "date":"2019-10-08T22:52:31-07:00"},
{"name": "carmen", "age": 20, "type": "customer", "credit": "Nil", "date":"2019-10-09T21:11:01-07:00"},
{"name": "karen", "age": 31, "type": "customer", "credit": "Nil", "date":"2019-10-08T20:09:16-07:00"},
{"name": "varmin", "age": 24, "type": "customer", "credit": "Nil", "date":"2019-10-08T12:21:45-07:00"},
]
I tried this, but logstash doesnt do anything when i run it:
input {
file {
path => "/home/waldo/credit_data/*.json"
start_position => "beginning"
sincedb_path => "/dev/null"
codec => json_lines
}
}
output {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "credit_data"
}
}
Tried both json and json lines. It doesnt seem to do anything. Also I would want the date to be filtered into elastic search as a date field.
I searched for this simple question, and wasnt able to find the answer although many of them have posted this and they have found the solution.
Any help is appreciated. Thankyou so much in advance!