Generate reports from a script in CSV is not working

i am trying to use a script to generate reports in CSV and i am following the steps as written in the documentation here
When i try to run a curl command i am getting error like this:

{"error":"Incorrect HTTP method for uri [/] and method [POST], allowed: [DELETE, GET, HEAD]","status":405}

Curl commnad is:

curl -XPOST "hostname:9200" -H 'Content-Type: application/json' -d'

Am i missing something or what is the problem?


Hi @thirty2. I think your Curl command is malformed. You are passing the report generation URL after the -d flag. The URL should be passed where you have hostname:9200.

So the official documentation is wrong too?
This is Copy as curl

curl -X POST "localhost:9200/\?pretty" -H 'Content-Type: application/json' -d'
-u elastic \ 
-H \u0027kbn-xsrf: true\u0027 \ 

from here and there is the report generation URL after -d flag too.

It is working with curl like this:

curl -XPOST -u yourUser-H 'kbn-xsrf: true ' ''

1 Like

Thanks for reporting, this is definitely a bug. I've created a pull request to fix the docs.