Elasticsearch tutorial bulkload

(Nikhil M) #1

I'm going through the Elasticsearch tutorials and i'm trying to load data from the sample file into Elasticsearch and i'm encountering a problem
curl -XPOST 'localhost:9200/bank/account/_bulk?pretty&refresh' --data-binary "@accounts.json"

i'm getting the following message when i run it on the Kibana console. I'm guessing there's an issue with the path of the file, where am i supposed to download the "accounts.json" file, i've downloaded it to the home directory of Elasticsearch, i've tried to put it in bin as well.
"error": {
"root_cause": [
"type": "parse_exception",
"reason": "Failed to derive xcontent"
"type": "parse_exception",
"reason": "Failed to derive xcontent"
"status": 400

(Isabel Drost-Fromm) #2

Could you please post the exact command you are running in the Kibana Console?

The curl command you posted is something you'd run from your favorite command-line/ shell, so that won't work as is in Kibana.

(Mark Walkom) #3

Also what version are you running?

(Nikhil M) #4

Hello, the curl command gets converted in a Kibana console anyways, so it doesn't matter, but here's what i'm running
POST /bank/account/_bulk?pretty&refresh-binary @accounts.json

I'm assuming i'd have to something about the path of this accounts.json file, like i said before i've put in the homedirectory of elastic search

(Nikhil M) #5

im running the latest version

(Mark Walkom) #6

You cannot post files to ES using sense, you will need to use curl directly.

(Nikhil M) #7

does to apply to the Kibana console as well? Would i be able to post files to ES from there?

(Mark Walkom) #8

Yes it does apply.

(system) #9

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