Vega in Kibana 6.8 | Cannot tap on a relative url in "href" | vega.enableExternalUrls | External URLs are not enabled

I am trying to create a very simple - but ultimately super practical example - of tapping a bar segment inside a Vega visualization and being able to go to the appropriate /discover url for the data.

When I try to do the above I get the following error, observing the networking logs - no network request is event made:

Uncaught Error: External URLs are not enabled. Add vega.enableExternalUrls: true to kibana.yml (https://mydomain.com/searchserv-dashboard/index-name/bundles/commons.bundle.js:3)

Version: 6.8.3
Build: 20430
Error: Uncaught Error: External URLs are not enabled. Add   vega.enableExternalUrls: true   to kibana.yml (https://mydomain.com/searchserv-dashboard/index-name/bundles/commons.bundle.js:3)
    at window.onerror (https://mydomain.com/searchserv-dashboard/index-name/bundles/commons.bundle.js:3:967594)

I just want to be able to link to the Discover pane from this visualization, this is not an external url at all, but a relative one.

Here is the json for the mark field I am using:

{
   "marks":[
      {
         "name":"Funnel Marks",
         "type":"rect",
         "style":"bar",
         "from":{
            "data":"Custom Data"
         },
         "encode":{
            "enter":{
               "x":{
                  "scale":"xscale",
                  "field":"my_field_property"
               },
               "width":{
                  "scale":"xscale",
                  "band":1
               },
               "y":{
                  "type":"quantitative",
                  "scale":"yscale",
                  "field":"total_counts"
               },
               "y2":{
                  "scale":"yscale",
                  "value":0
               }
            },
            "update":{
               "cursor":{
                  "value":"pointer"
               },
               "href":{
                  "value":"/discover/my/relative/url"
               },
               "fill":{
                  "value":"steelblue"
               }
            },
            "hover":{
               "fill":{
                  "value":"lightblue"
               }
            }
         }
      }
   ]
}

Why is this not working as intended?

As I understand this, this makes Vega visualizations almost impractical as I can't drill down into the data, and this is also running on Elastic Cloud.

@joshdover I noticed you helped out on a similar issue here: Dashboard links requires vega.enableExternalUrls: true

But there was no resolution I believe

I had the same issue and the only resolution was to add what it wants to kibana.yml that I found. Added that, restarted and works. Believe I also had to use the full URL and not just the relative too.

vega.enableExternalUrls: true

Unfortunately this is not possible to do in Elastic Cloud as external urls are not permitted due to security reasons

Ahh got ya. I haven't used the Cloud so not sure. Have you attempted to use the full URL so it knows it's not external?

               "href":{
                  "value":"/discover/my/relative/url"
               }

I did :slight_smile: and that does not work either, it will throw the same error.

Kibana team you should allow users to proceed with a relative url right?

I investigated the issues and it seems that it calls a function in the commons bundle, window.onerror and will through a fatal error without dispatching or trying a network request.

For context here is the relative url I tried, (I hard coded it in to test):

/searchserv-dashboard/index-name/app/kibana#/discover?_g=h@95vjc6b1&_a=h@2jhjjd2

Are you using ES cloud? if yes. not possible. also did not get any updates when if at all this will be feasible.

But working fine if you are hosting this on AWS/GCP. we have couple clusters there it is working fine.

as workaround, at least that works for us. we loaded the external data manually and doing enrichment for the docs so we can have the information in Vega.
important note, there are issues with enrichment processor. that should be fixed in latest version. but did not get to check in production.

Hi @DavidKHE thanks for the explanation.

I'll verify with my team if we are on Elastic Cloud or AWS/GCP (I assumed the issues would be the same across all).

Can you clarify what you mean by this:

as workaround, at least that works for us. we loaded the external data manually and doing enrichment for the docs so we can have the information in Vega.
important note, there are issues with enrichment processor. that should be fixed in latest version. but did not get to check in production.

How would I follow the same setup there you listed out? ^

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