# Failing to upload json file to elasticsearch

**URL:** <https://discuss.elastic.co/t/failing-to-upload-json-file-to-elasticsearch/83481>\
**Category:** Elasticsearch\
**Created:** [April 25, 2017, 2:57am UTC](https://discuss.elastic.co/t/failing-to-upload-json-file-to-elasticsearch/83481 "2017-04-25T02:57:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sraghu1980](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@sraghu1980](https://discuss.elastic.co/u/sraghu1980)\
**Post date:** [April 25, 2017, 2:57am UTC](https://discuss.elastic.co/t/failing-to-upload-json-file-to-elasticsearch/83481/1 "2017-04-25T02:57:55Z")

</div>

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](http://localhost:9200/raghutest6)  
{"acknowledged":true}

failing to upload test.json to elasticsearch:  
curl -X PUT '[http://localhost:9200/raghutest6](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

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 25, 2017, 2:58am UTC](https://discuss.elastic.co/t/failing-to-upload-json-file-to-elasticsearch/83481/2 "2017-04-25T02:58:59Z")

</div>

> [@sraghu1980](#):
>
> [{"epoch": "1493072514.658", "value": "96.638099"}]

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 23, 2017, 3:13am UTC](https://discuss.elastic.co/t/failing-to-upload-json-file-to-elasticsearch/83481/3 "2017-05-23T03:13:03Z")

</div>

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