# Elasticsearch bulk insert JSON file

**URL:** <https://discuss.elastic.co/t/elasticsearch-bulk-insert-json-file/47814>\
**Category:** Elasticsearch\
**Created:** [April 19, 2016, 4:51pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-insert-json-file/47814 "2016-04-19T16:51:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amlife](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@amlife](https://discuss.elastic.co/u/amlife)\
**Post date:** [April 19, 2016, 4:51pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-insert-json-file/47814/1 "2016-04-19T16:51:10Z")

</div>

have the following [JSON](http://pastebin.com/raw/r2pdcaW8) file

I have used awk to get rid of empty spaces, trailing, next line

`awk -v ORS= -v OFS= '{$1=$1}1' data.json`

I have added a create request at the top of my data.json followed by \n and the rest of my data.

When I issue bulk submit request, I get the following error

`CURL -XPUT http://localhost:9200/_bulk --data-binary @data.json`

```
{
  "took": 1,
  "errors": true,
  "items": [
    {
      "create": {
        "_index": "socteam",
        "_type": "products",
        "_id": "AVQuGPff-1Y7OIPIJaLX",
        "status": 400,
        "error": {
          "type": "mapper_parsing_exception",
          "reason": "failed to parse",
          "caused_by": {
            "type": "not_x_content_exception",
            "reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
          }
        }
      }
    }
  ]

```

Any idea on what this error mean? I haven't created any mapping, I'm using vanilla elasticsearch

---

<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 19, 2016, 10:42pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-insert-json-file/47814/2 "2016-04-19T22:42:06Z")

</div>

What does the actual file you look like sent, after you have added the bulk stuff.

---

<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:** [July 5, 2017, 10:57pm UTC](https://discuss.elastic.co/t/elasticsearch-bulk-insert-json-file/47814/3 "2017-07-05T22:57:53Z")

</div>


