Create data for Elasticsearch bulk

Hi everybody.

I would like to create data for the Elasticsearch bulk API.
The problem is that two lines are requested in the bulk file for one entry in ES database: The command line (index in my example), and the data line (field1).

{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }

Is there a way to generate this kind of thing?

Tanks a lot

Not exactly, the closest you could get would be this:

It would require some post-processing to split the “value” object and “index” object into separate rows.

OK, thanks for your answer.

But I was wrong: for Elasticsearch bulk, you have to write the command line only one time. So it is not a problem for me anymore. I’ll add this line manually.

Thanks again