Failing to upload json file to elasticsearch


(Raghu) #1

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


(Mark Walkom) #2

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


(system) #3

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