Using external Json-Queries in Kibana-Console with load_from

Hello,

I have a hard time to get the "load_from" parameter working?!

My call:

http://localhost:5601/app/kibana#/dev_tools/console?load_from=http://localhost:8090/myApplication/elasticQuery.json

My Kibana-Console (DevTools) opens in the browser. But the script in "elasticQuery.json" is not loaded. It exists and is also from doc-type "application/json". I have no idea whats going wrong....

When referring a json from the Elastic-Doc it works. For example:
http://localhost:5601/app/kibana#/dev_tools/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/query-dsl-term-query/1.json

Any idea what's going wrong?
Can I enable a logging somewhere to see what's going wrong?

Thanks
Mos

anyone?

Note: Also with logging.verbose: true there is no indication, why the "load_from" content is not loaded into the Kibana Console?

@mos Console will currently only load scripts when they're served over https

1 Like

Hi Brandon,

I tested this also. Doesn't work. For example - try to load this via load_from:

https://www.jobpushy.de/weblog/parseElasticCommands/1.json

In load_from parameter:

http://localhost:5601/app/kibana#/dev_tools/console?load_from=https://www.jobpushy.de/weblog/parseElasticCommands/1.json

Thanks
Mos

The following error is preventing Kibana from loading the script: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:5601' is therefore not allowed access.

The server hosting the .json file must provide certain headers allowing us load the file. This is part of CORS, further explained here: Cross-Origin Resource Sharing (CORS) - HTTP | MDN

1 Like

Thanks, Brandon.
How did you have been able to see the log-entry?

@mos it was in the Console of the Developer Tools. If you're using Google Chrome, you can right click and select "Inspect Element" which will then show you the Developer Tools. Other browsers have something similar, if you aren't using Google Chrome and you are having issues finding the console logs, if you let me know which browser you're using I can walk you through the process.

Thanks! Problem solved :slight_smile:

Works like a charm. Try it at the bottom of the page by clicking on the Kibana image:

(by the way, it works also for non https connections...)

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