Failing to upload json file to elasticsearch

Hi,

My test.csv has:
epoch,value
1493072514.658,96.638099

test.json has:
[{"epoch": "1493072514.658", "value": "96.638099"}]

Created elastic search index using:
#curl -X POST http://localhost:9200/raghutest6
{"acknowledged":true}

failing to upload test.json to elasticsearch:
curl -X PUT 'http://localhost:9200/raghutest6' --data-binary @test.json
{"error":{"root_cause":[{"type":"parse_exception","reason":"malformed, expected settings to start with 'object', instead was [START_ARRAY]"}],"type":"settings_exception","reason":"Failed to load settings from [[{"epoch": "1493072514.658", "value": "96.638099"}]]","caused_by":{"type":"parse_exception","reason":"malformed, expected settings to start with 'object', instead was [START_ARRAY]"}},"status":500}

Is there any alternative way to upload csv/json file to elasticsearch server?

-Raghu

That is not valid json, I think you need to remove the [].

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