Hello everyone, i'm new using elasticsearch,
i am trying to index a json file with bulk, but it doesn't work,
i use jq to have the good format :
cat monitor.json | jq -c '.[] | {"index": {"_index": "monitoring", "_type": "monitoring", "_id": .id}}, .'
this is the result :
{"index":{"_index":"monitoring","_type":"monitoring","_id":null}}
{"temperature":"47","cpu":"1","ramtotal":"925","ramlibre":"502","ramswap":"0","memoireutil":"21","ramutil":"423","hdmi":"0x40001","ping":"4","date":"2017-06-21"}
and when i try to add it with the following line :
cat monitor.json | jq -c '.[] | {"index": {"_index": "monitoring", "_type": "monitoring", "_id": .id}}, .' | curl --header "Content-Type:application/json" -XPOST localhost:9200/_bulk --data-binary @monitor.json
i get this error :
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Malformed action/metadata line [1], expected START_OBJECT or END_OBJECT but found [FIELD_NAME]"}],"type":"illegal_argument_exception","reason":"Malformed action/metadata line [1], expected START_OBJECT or END_OBJECT but found [FIELD_NAME]"},"status":400}
do you have an idea of what is the problem?
thank you!