How to use the bulk api from kibana

I am trying to upload data using the bulk api from kibana.

I was following this

I have tried a syntax like this:

POST /my-index/_bulk
{
  { "index": { "_index": "myindex", "_id": "1" } }
  { "name": "John Doe", "age": 30, "city": "New York" }
}

But then I get this:

{
  "error": {
    "root_cause": [
      {
        "type": "x_content_e_o_f_exception",
        "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
      }
    ],
    "type": "x_content_e_o_f_exception",
    "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]""",
    "caused_by": {
      "type": "json_e_o_f_exception",
      "reason": """Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
    }
  },
  "status": 500
}

Then I tried something like this so that the json is valid:

POST /my-index/_bulk
{
    "index": {
        "_index": "my-index",
        "_id": "1"
    },
    "source": {
        "sourceId": "1"
    }
}

but I get the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "x_content_e_o_f_exception",
        "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
      }
    ],
    "type": "x_content_e_o_f_exception",
    "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]""",
    "caused_by": {
      "type": "json_e_o_f_exception",
      "reason": """Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
    }
  },
  "status": 500
}

Is there an example of using the bulk api via kibana?

Hi @Carlos_Fernando_Palm

So close... :slight_smile: see the docs

POST /news_v11/_bulk
{ "index": { "_index": "myindex", "_id": "1" } }
{ "name": "John Doe", "age": 30, "city": "New York" }