0

I am following the tutorial in https://www.elastic.co/guide/en/kibana/current/getting-started.html

I downloaded the sample json files and put it in
/mydirectory/data/accounts.json

according to the documentation, you would type curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json

Of course then you get an error { "statusCode": 400, "error": "Bad Request", "message": "child \"uri\" fails because [\"uri\" must be a valid uri]", "validation": { "source": "query", "keys": [ "uri" ] } }

because I don't see anyway to indicate which directory I stored the json file. How do you get it to know where to find the search. I googled all around, and am amazed to not find the answer. How did everybody else figure this out?

bhomass
  • 3,414
  • 8
  • 45
  • 75

1 Answers1

1

You need to specify the full path after the @ character, like this

curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @/mydirectory/data/accounts.json

An alternative is to first run cd /mydirectory/data and then you can use

curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json
Val
  • 207,596
  • 13
  • 358
  • 360
  • I did already try that. same result. { "statusCode": 400, "error": "Bad Request", "message": "child \"uri\" fails because [\"uri\" must be a valid uri]", "validation": { "source": "query", "keys": [ "uri" ] } } Maybe the problem is else where? – bhomass Apr 01 '16 at 17:18
  • ok, I got it to work. I was doing this using kibana sense, and the post did not work there. I will accept your answer. – bhomass Apr 01 '16 at 17:23