# Bulk import does nothing

**URL:** <https://discuss.elastic.co/t/bulk-import-does-nothing/176893>\
**Category:** Elasticsearch\
**Created:** [April 15, 2019, 11:45am UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893 "2019-04-15T11:45:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thebuleon29](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@thebuleon29](https://discuss.elastic.co/u/thebuleon29)\
**Post date:** [April 15, 2019, 11:45am UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893/1 "2019-04-15T11:45:24Z")

</div>

Hi,  
I am trying to import a NDJSON file in ElasticSearch but it does absolutly nothing. Here is an sample of the file :

```
{ "create" : { "_index" : "benchmark", "_type" : "doc", "_id" : "1" }}
{ "timestamp" : 1516367192636718750, "name" : "SREMTWTAA", "spid" : "10350", "alert" : "0.0", "curve" : "TF9", "engValidity" : "1.0", "engValue" : "OFF", "id" : "4.0", "limits" : "-", "monState" : "OK", "rawValidity" : "1.0", "sample" : "1.0", "bitOffset" : 205.0, "bitSize" : 1.0, "pk" : 102.0, "rawValue" : 0, "reveivedTime" : 1.516367195445e+18 }

```

The entire file is 3357174 lines long, but the command runs in 1 second and does absolutely nothing. I use the command :

`curl -s -H "Content-Type: application/x-ndjson" -XPOST 'localhost:9200/_bulk' --data-binary @file.ndjson`

When I don't put the '@' it says "The bulk request must be terminated by a newline [\n]" but I don't think it is related to my problem as my file ends with an empty line and a '\n' character.

I also tried to use the examples from [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html) and it works.

```
{ "index" : { "_index" : "test", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_id" : "2" } }
{ "create" : { "_index" : "test", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_index" : "test"} }
{ "doc" : {"field2" : "value2"} }

```

I don't see the difference betweem this file and mine... Please help 😢

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 15, 2019, 11:49am UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893/2 "2019-04-15T11:49:09Z")

</div>

> [@thebuleon29](#):
>
> does absolutely nothing

Can you clarify what this means? Do you get a response or an error message? Do you see any messages in the log file? Can you share more information about what you're seeing?

---

<div class="post-metadata">

**Author:** ![thebuleon29](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@thebuleon29](https://discuss.elastic.co/u/thebuleon29)\
**Post date:** [April 15, 2019, 12:29pm UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893/3 "2019-04-15T12:29:39Z")

</div>

By nothing I mean no output : the command just stops without printing anything.

I am running ElasticSearch in a docker container, and I have no idea of where t find the log file

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 15, 2019, 12:49pm UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893/4 "2019-04-15T12:49:19Z")

</div>

What is the size of the complete file? The bulk interface is designed to allow you to send multiple (not necessarily all) documents in a single request. It is typically recommended to keep the size of each bulk request below 5MB in size.

---

<div class="post-metadata">

**Author:** ![thebuleon29](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@thebuleon29](https://discuss.elastic.co/u/thebuleon29)\
**Post date:** [April 15, 2019, 1:04pm UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893/5 "2019-04-15T13:04:59Z")

</div>

The file size is 708 MB. I tried with a shorter version (10 first lines) and it works ! Thanks a lot !

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 16, 2019, 6:56am UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893/6 "2019-04-16T06:56:28Z")

</div>

> [@thebuleon29](#):
>
> I have no idea of where t find the log file

It's probably a good idea to work this out before you need it again. The log is the first place to look when things go wrong. By default Elasticsearch logs most things to `stdout`, and I think the default for the Docker image is to also log to `/usr/share/elasticsearch/logs` which you can bind-mount to somewhere persistent.

---

<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 14, 2019, 6:56am UTC](https://discuss.elastic.co/t/bulk-import-does-nothing/176893/7 "2019-05-14T06:56:31Z")

</div>

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