Curl against Kibana does not work at all

Hey folks,

I am currently trying to trigger an Elasticsearch snapshot using curl. However curl against Kibana does not work at all for me. I am trying to execute the commands from the documentation: https://www.elastic.co/guide/en/elasticsearch/reference/6.2/modules-snapshots.html

My elastic stack runs in Docker containers and 5601 is open on the host. I can use the GUI.

curl -X PUT "https://my.elk.server:5601/app/kibana#/dev_tools/console/_snapshot/my_backup/snapshot_1?wait_for_completion=true"
{"statusCode":404,"error":"Not Found"}

The only error I get, even with LOGGING_VERBOSE: true, is this:

{"type":"response","@timestamp":"2018-04-18T14:14:05Z","tags":[],"pid":1,"method":"put","statusCode":404,"req":{"url":"/app/kibana","method":"put","headers":{"host":"master.elk.demo:5601","user-agent":"curl/7.52.1","accept":"*/*","content-type":"application/json","content-length":"102"},"remoteAddress":"10.200.14.80","userAgent":"10.200.14.80"},"res":{"statusCode":404,"responseTime":26,"contentLength":9},"message":"PUT /app/kibana 404 26ms - 9.0B"}

The commands works from the Kibana GUI btw.

curl ing against the GUI itself works aswell and returns a HTML document.

curl "https://my.elk.server:5601/app/kibana"

Does anyone have an idea what I am doing wrong?

Best regards

I think you are querying the wrong endpoint. You want to send a request against Elasticsearch and not against Kibana. So you should use your Elasticsearch instance and append the _snapshot URL there. Nothing will happen if you are trying to query Kibana for Elasticsearch APIs :slight_smile:

Cheers,
Tim

@timroes Thanks for the reply, I was just using this because the documentation says so... Do you mind taking a look at the link I posted to check if the documentation is wrong here?

That's definitely weird. I will check if those URLs should work. What works: go to the gear icon and replace the dev tools URL by the base URL of your elasticsearch, that way you will get proper Elasticsearch URLs copied as curl. I will need to figure out whether or not that dev tools URL are an issue in Kibana or in our docs.

Thanks,
Tim

Thank you very much! I was using the "COPY AS CURL" links below the actual commands.

The commands in the documentation work, when I execute them via the Kibana DevTools.

Yeah apparently the dev tools earlier forwarded those requests, that's why we could build these based on you configuring your Kibana URL, but that feature seems not to exist anymore, so we need to fix the documentation here.

Thanks a lot for checking! May I submit a bug against the documentation somewhere?

Hi Valentin,

not necessary at the moment. I already informed the responsible people, so they can have a look at it :slight_smile:

Thanks a lot for pointing that out!

Cheers,
Tim

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