# Disable output from bulk inserts

**URL:** <https://discuss.elastic.co/t/disable-output-from-bulk-inserts/10865>\
**Category:** Elasticsearch\
**Created:** [February 24, 2013, 6:02am UTC](https://discuss.elastic.co/t/disable-output-from-bulk-inserts/10865 "2013-02-24T06:02:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave\_O](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dave_o/32/69398_2.png) [@Dave\_O](https://discuss.elastic.co/u/Dave_O)\
**Post date:** [February 24, 2013, 6:02am UTC](https://discuss.elastic.co/t/disable-output-from-bulk-inserts/10865/1 "2013-02-24T06:02:42Z")

</div>

I just loaded a hundred thousand records using the bulk API. A the very  
end I receive the OK messages for each and every one of my inserts.  
Scrolls for about 2 minutes. Is there a way to disable this?

Second question. Is it possible when using the bulk API that you just  
reference the Index in the CURL statement and then in the actual file just  
have the actual data records.  
Currently I have to basically repeat the Index every other line such as  
{ "index" : {\_index" : .........  
{"col1": val, "col2": val ......  
{ "index" : {\_index" : .........  
{"col1": val, "col2": val ......

It would be nice if it was just like the following in the file  
{"col1": val, "col2": val ......  
{"col1": val, "col2": val ......  
{"col1": val, "col2": val ......  
{"col1": val, "col2": val ......  
{"col1": val, "col2": val ......

Thank you

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Dave\_O](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dave_o/32/69398_2.png) [@Dave\_O](https://discuss.elastic.co/u/Dave_O)\
**Post date:** [February 24, 2013, 4:03pm UTC](https://discuss.elastic.co/t/disable-output-from-bulk-inserts/10865/2 "2013-02-24T16:03:26Z")

</div>

So I modified my input file (input.json) to look like  
{ "index" : {"\_index" : "names", "\_type" : "ind1", "\_id" : "3038814",  
"field1": "T", "field2": "00"...}}  
{ "index" : {"\_index" : "names", "\_type" : "ind1", "\_id" : "3038815",  
"field1": "T", "field2": "00"...}}  
/n (new line at end)

and it appears to work, however it only loads the FIRST record and then  
returns??

curl -s XPOST localhost:9200/\_bulk --data-binary @input.json; echo

Any thoughts on why it's only loading first record. Thanks

On Sunday, February 24, 2013 1:02:42 AM UTC-5, Mike Oakes wrote:

> I just loaded a hundred thousand records using the bulk API. A the very  
> end I receive the OK messages for each and every one of my inserts.  
> Scrolls for about 2 minutes. Is there a way to disable this?
> 
> Second question. Is it possible when using the bulk API that you just  
> reference the Index in the CURL statement and then in the actual file just  
> have the actual data records.  
> Currently I have to basically repeat the Index every other line such as  
> { "index" : {\_index" : .........  
> {"col1": val, "col2": val ......  
> { "index" : {\_index" : .........  
> {"col1": val, "col2": val ......
> 
> It would be nice if it was just like the following in the file  
> {"col1": val, "col2": val ......  
> {"col1": val, "col2": val ......  
> {"col1": val, "col2": val ......  
> {"col1": val, "col2": val ......  
> {"col1": val, "col2": val ......
> 
> Thank you

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 24, 2013, 5:50pm UTC](https://discuss.elastic.co/t/disable-output-from-bulk-inserts/10865/3 "2013-02-24T17:50:46Z")

</div>

The second format you use is incorrect. Essentially you are just specifying  
a meta-data line, and not the document properties itself.

Your first format is correct. If you pass the index and type in the URL,  
then you can reduce your metadata line to the minimum, eg:

```
{ index: { id: 3038814}}\n
{ field1: "T", etc }\n

```

clint

On Sun, Feb 24, 2013 at 5:03 PM, Mike Oakes [mdoakes42@gmail.com](mailto:mdoakes42@gmail.com) wrote:

> So I modified my input file (input.json) to look like  
> { "index" : {"\_index" : "names", "\_type" : "ind1", "\_id" : "3038814",  
> "field1": "T", "field2": "00"...}}  
> { "index" : {"\_index" : "names", "\_type" : "ind1", "\_id" : "3038815",  
> "field1": "T", "field2": "00"...}}  
> /n (new line at end)
> 
> and it appears to work, however it only loads the FIRST record and then  
> returns??
> 
> curl -s XPOST localhost:9200/\_bulk --data-binary @input.json; echo
> 
> Any thoughts on why it's only loading first record. Thanks
> 
> On Sunday, February 24, 2013 1:02:42 AM UTC-5, Mike Oakes wrote:
> 
> > I just loaded a hundred thousand records using the bulk API. A the very  
> > end I receive the OK messages for each and every one of my inserts.  
> > Scrolls for about 2 minutes. Is there a way to disable this?
> > 
> > Second question. Is it possible when using the bulk API that you just  
> > reference the Index in the CURL statement and then in the actual file just  
> > have the actual data records.  
> > Currently I have to basically repeat the Index every other line such as  
> > { "index" : {\_index" : .........  
> > {"col1": val, "col2": val ......  
> > { "index" : {\_index" : .........  
> > {"col1": val, "col2": val ......
> > 
> > It would be nice if it was just like the following in the file  
> > {"col1": val, "col2": val ......  
> > {"col1": val, "col2": val ......  
> > {"col1": val, "col2": val ......  
> > {"col1": val, "col2": val ......  
> > {"col1": val, "col2": val ......
> > 
> > Thank you
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:49am UTC](https://discuss.elastic.co/t/disable-output-from-bulk-inserts/10865/4 "2017-07-06T02:49:48Z")

</div>


