# Loading Sample Dataset

**URL:** <https://discuss.elastic.co/t/loading-sample-dataset/80372>\
**Category:** Elasticsearch\
**Created:** [March 28, 2017, 8:19pm UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372 "2017-03-28T20:19:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozersubasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ozersubasi/32/16821_2.png) [@ozersubasi](https://discuss.elastic.co/u/ozersubasi)\
**Post date:** [March 28, 2017, 8:19pm UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/1 "2017-03-28T20:19:03Z")

</div>

I have trouble for the load dataset. I have a json dataset and I wanna load on Elasticsearch 5.3  
my json dataset is at `C:/elk/elasticsearch/data/account.json` I want to use this =\> and I use  
`curl -H "Content-Type: application/json" -XPOST 'localhost:9200/bank/account/_bulk?pretty&refresh' --data-binary "@accounts.json"`  
code, how to change this code for use and receive this  
response for `curl 'localhost:9200/_cat/indices?v'`

```
    health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
    yellow open bank l7sSYV2cQXmu6_4rJWVIww 5 1 1000 0 128.6kb 128.6kb
```

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 29, 2017, 6:59am UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/2 "2017-03-29T06:59:20Z")

</div>

What does the account.json file look like? The bulk API expects a specific format, with metadata about the documents to index on one line, followed by the actual document. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html)

---

<div class="post-metadata">

**Author:** ![ozersubasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ozersubasi/32/16821_2.png) [@ozersubasi](https://discuss.elastic.co/u/ozersubasi)\
**Post date:** [March 29, 2017, 8:10am UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/3 "2017-03-29T08:10:20Z")

</div>

my accounts.json file is [accounts.json](https://raw.githubusercontent.com/elastic/elasticsearch/master/docs/src/test/resources/accounts.json)  
I couldn't solve this, I receive parse error on kibana server when I wanna index this dataset. Can you explain this little more?

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 29, 2017, 8:20am UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/4 "2017-03-29T08:20:19Z")

</div>

What error message are you getting? I just tried the command you provided locally and it worked for me on a fresh install of Elasticsearch 5.3.0.

---

<div class="post-metadata">

**Author:** ![ozersubasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ozersubasi/32/16821_2.png) [@ozersubasi](https://discuss.elastic.co/u/ozersubasi)\
**Post date:** [March 29, 2017, 10:55am UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/5 "2017-03-29T10:55:06Z")

</div>

It seems like this.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/f/e/fef2623f5577be97beeae733eab9baab466035ea.jpg)

And I also receive like this when I look F12  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/7/e7b2ffaa96ff04f9c1024ea728f05833ca7905c8.png)

then I receive

> " Failed to connect to Console's backend.  
> Please check the Kibana server is up and running"

but I see Kibana server is open. I'm confused 😶

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 29, 2017, 12:02pm UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/6 "2017-03-29T12:02:23Z")

</div>

Oh, this command is expected to be run on the command-line, not from Kibana's console. If you want to run it from Kibana's console, here is what you need to run:

```auto
POST bank/account/_bulk?pretty&refresh
{"index":{"_id":"1"}}
{"account_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes Lane","employer":"Pyrami","email":"amberduke@pyrami.com","city":"Brogan","state":"IL"}
{"index":{"_id":"6"}}
{"account_number":6,"balance":5686,"firstname":"Hattie","lastname":"Bond","age":36,"gender":"M","address":"671 Bristol Street","employer":"Netagy","email":"hattiebond@netagy.com","city":"Dante","state":"TN"}
{"index":{"_id":"13"}}
{"account_number":13,"balance":32838,"firstname":"Nanette","lastname":"Bates","age":28,"gender":"F","address":"789 Madison Street","employer":"Quility","email":"nanettebates@quility.com","city":"Nogal","state":"VA"}
{"index":{"_id":"18"}}
{"account_number":18,"balance":4180,"firstname":"Dale","lastname":"Adams","age":33,"gender":"M","address":"467 Hutchinson Court","employer":"Boink","email":"daleadams@boink.com","city":"Orick","state":"MD"}
{"index":{"_id":"20"}}
{"account_number":20,"balance":16418,"firstname":"Elinor","lastname":"Ratliff","age":36,"gender":"M","address":"282 Kings Place","employer":"Scentric","email":"elinorratliff@scentric.com","city":"Ribera","state":"WA"}
{"index":{"_id":"25"}}
{"account_number":25,"balance":40540,"firstname":"Virginia","lastname":"Ayala","age":39,"gender":"F","address":"171 Putnam Avenue","employer":"Filodyne","email":"virginiaayala@filodyne.com","city":"Nicholson","state":"PA"}
{"index":{"_id":"32"}}
{"account_number":32,"balance":48086,"firstname":"Dillard","lastname":"Mcpherson","age":34,"gender":"F","address":

GET _cat/indices?v

```

I truncated the content of `accounts.json` to keep it readable, but to have 1000 docs in the end as expected, you need to put the whole content of that file below the `POST _bulk` line.

---

<div class="post-metadata">

**Author:** ![ozersubasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ozersubasi/32/16821_2.png) [@ozersubasi](https://discuss.elastic.co/u/ozersubasi)\
**Post date:** [March 29, 2017, 8:25pm UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/7 "2017-03-29T20:25:51Z")

</div>

Oh, thank you. I'm trying wrong function for three days... Thanks for the solution 😌

---

<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:** [April 26, 2017, 8:26pm UTC](https://discuss.elastic.co/t/loading-sample-dataset/80372/8 "2017-04-26T20:26:36Z")

</div>

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