Can't get data from timelion API using curl when in the dev mode

Kibana, tag v6.2.4, official repo https://github.com/elastic/kibana.

Run Kibana

cd kibana
npm start

Run curl

curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" -H "kbn-xsrf: anything" -H "Connection: keep-alive" localhost:5601/api/timelion/run -d '{"s
heet":[".es(*).label(all)"],"time":{"from":"now-15m","interval":"auto","mode":"quick","timezone":"Europe/Berlin","to":"now"}}'

Response

{"statusCode":404,"error":"Not Found","message":"Not Found"}

But it works if Kibana is not the dev mode.

Run Kibana

cd kibana
./bin/kibana

Run curl

 curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" -H "kbn-xsrf: anything" -H "Connection: keep-alive" localhost:5601/api/timelion/run -d '{"s
heet":[".es(*).label(all)"],"time":{"from":"now-15m","interval":"auto","mode":"quick","timezone":"Europe/Berlin","to":"now"}}'                                                                              

Response

{"sheet":[{"type":"seriesList","list":[{"data":[[1533667372000,0],[1533667373000,0],....

Why do I get 404 response in the dev mode? How to query the timelion API in the dev mode?

When you run kibana in dev-mode, it starts up under a nested path. Usually 3 random letters precede the location of the Kibana-app.

e.g.

localhost:5601/foo/api/timelion/runinstead of localhost:5601/api/timelion/run

Could you check if the URL you post your message to exists?

1 Like

@thomasneirynck you are right.

Kibana added 3 letter word pzd in the dev mode: http://192.168.1.111:5601/pzd/app/kibana

I added this word to curl url and got correct response.

curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" -H "kbn-xsrf: anything" -H "Connection: keep-alive" localhost:5601/pzd/api/timelion/run -d '{"s
heet":[".es(*).label(all)"],"time":{"from":"now-15m","interval":"auto","mode":"quick","timezone":"Europe/Berlin","to":"now"}}'                                                                              

Thank you.

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