Elasticsearch - Bulk insert using Sense Web Plugin in Windows

3k views Asked by At

I am trying to import the accounts.json data using _bulk api as per the elastic search tutorial( https://www.elastic.co/guide/en/kibana/current/getting-started.html ). I'm using google-chrome's Sense plugin for this task.

When i paste the url curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json on Sense, its converted to POST /bank/account/_bulk?pretty.

The solution here : Kibana: Cant import Shakespeare.json on Sense Web Plugin, says, to use CURL command. But on windows, the curl command is not recognized.

curl -XPUT localhost:9200/_bulk --data-binary @shakespeare.json 'curl' is not recognized as an internal or external command, operable program or batch file.

2

There are 2 answers

0
Dmytro Shevchenko On

Just to have the correct answer:

  1. Download curl for Windows here: https://curl.haxx.se/download.html

    Direct link to curl-7.54.1-win64-mingw

  2. Unpack the bin folder from the archive somewhere on your local drive.

  3. Add the path to that folder to your PATH system variable.

  4. Restart your explorer.exe process or restart Windows. This is needed in order for the shell to refresh the value of PATH.

  5. In the command-line shell, execute the following command:

    curl -XPOST localhost:9200/{some path here}/_bulk?pretty --data-binary @{file name}
    
1
Nishant On

Try this:

POST /<indexName>/<type>/_bulk

Copy the contents of the files accounts.json

and run.