Kibana: Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly

Created on 17 Apr 2019  路  35Comments  路  Source: elastic/kibana

Kibana version:
Kibana 7.0.0 through Kibana 7.5.0

Elasticsearch version:
Elasticsearch 7.0.0 through Elasticsearch 7.5.0

Server OS version:
Ubuntu 16.04

Browser version:
Chromium 73

Browser OS version:
Ubuntu 16.04

Original install method (e.g. download page, yum, from source, etc.):
Docker

Describe the bug:
In Kibana 6.5.4, I can set a URL field formatter on an IP field using a relative hyperlink (no https://servername at the beginning) and it will render the hyperlink properly.

In Kibana 7.0.0 and higher, the same relative hyperlink on an IP field does not render properly. Further testing reveals that relative hyperlinks on string fields do render properly.

Steps to reproduce:

  1. Set a URL field formatter on an IP field to a relative hyperlink. For example: /RelativeHyperlink
  2. View the resulting formatted IP field on a dashboard.
  3. The field will not be hyperlinked and thus not clickable.

Expected behavior:
Kibana 7.0.0 and higher should render the hyperlink properly as previous versions of Kibana did.

Screenshots (if relevant):
Here's a screenshot of Kibana 6.5.4 rendering relative hyperlinks properly:
6 5 4_working_properly

Here's a screenshot of Kibana 7.0.0 rendering those same relative hyperlinks incorrectly:
7 0 0_not_rendering_properly

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

AppServices bug regression

Most helpful comment

Just tested Kibana 7.3.1 and confirmed this is still an issue. Is there any other information I can provide to help with getting this issue resolved?

All 35 comments

Pinging @elastic/kibana-app-arch

Hi @lukeelmers ,

Thanks for adding the labels. I see that elasticmachine pinged the kibana-app-arch team, but if I click on that link (https://github.com/orgs/elastic/teams/kibana-app-arch), I get Page not found, so does that team no longer exist?

Please let me know if I can provide any more information to get this issue resolved.

Thanks!

Thanks @dougburks! Don鈥檛 worry, the ping went to the right team :) I鈥檓 guessing the team page is private to the elastic org maybe?

We are going to take a look at and will follow up with any questions for you.

Thanks for confirming @lukeelmers !

After more testing, it seems like this issue happens on fields of type IP, but not on fields of type string. I've updated the initial description to reflect this.

I've also been trying to pinpoint where in the source this URL formatting happens, but I'm not familiar with the Kibana codebase. It looks like in 6.5.4, the relevant file for URL formatting is src/core_plugins/kibana/common/field_formats/types/url.js but that file was moved in 7.0.0 to src/legacy/core_plugins/kibana/common/field_formats/types/url.js.

Am I on the right track?

I just tested Kibana 7.0.1 and this is still an issue:
7 0 1

Any chance of this getting resolved in 7.0.2?

Thanks!

What I have found is that doesn't matter if it is an IP or a string. The issue occurs with both.

From my testing it occurs when a relative path URL is used.

For example the following relative URL worked in all 6.x versions through 6.6.2 (I didn't test later versions), but has problems with 7.x versions...

kibana#/dashboard/402b3910-068d-11e8-b8c9-63672ef3f062?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!f,index:'logs-conn-*',key:conn.client_hostname,negate:!f,params:(query:'{{value}}',type:phrase),type:phrase,value:'{{value}}'),query:(match:(conn.client_hostname:(query:'{{value}}',type:phrase))))))

However when the full URL including domain is used, it works.

http://www.domain.name/app/kibana#/dashboard/402b3910-068d-11e8-b8c9-63672ef3f062?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!f,index:'logs-conn-*',key:conn.client_hostname,negate:!f,params:(query:'{{value}}',type:phrase),type:phrase,value:'{{value}}'),query:(match:(conn.client_hostname:(query:'{{value}}',type:phrase))))))

Unfortunately adding the full URL as a workaround doesn't really work. Some users connect with only the IP address of the Kibana server, and other the full URL, which would be problematic. Also this would prevent the index pattern from being exported from one environment and imported into another (the server/domain name portion of the URL would be wrong in other environments).

What I also noticed is that not everything is affected. The field formatter configuration page, and the table visualization have the problem. However, viewing the field in Explorer (or a saved search) does not.

Table Visualization:

image

Saved search:

image

Just tested Kibana 7.2.0 and confirmed this is still an issue. Is there any other information I can provide to help with getting this issue resolved?

I would like to upvote the issue.
We have a string field with url format and it worked till 6.7.1 and is now broken using 7.1.1

Just tested Kibana 7.3.1 and confirmed this is still an issue. Is there any other information I can provide to help with getting this issue resolved?

Looks like that our problem is not important enough to get fixed :-(

Just tested Kibana 7.3.2 and confirmed this is still an issue. Is there any other information I can provide to help with getting this issue resolved?

@bicaluv @dougburks Sorry for been a long time. The bug is being reviewed.

Still an issue in 7.3 as well, the columns seem to work but the documents do not. This isn't just URL's, but images too.

image

Screen Shot 2019-09-26 at 12 37 08 PM

sorry, it looks like @Avinar-24 created the original PR. Same question 馃槃

@alexfrancoeur Yes, it will be delivered with 7.4.x

Not fixed in 7.4.1 in this PR: https://github.com/elastic/kibana/pull/46332

@Avinar-24 please make sure this issue is backport to 7.4.x

I'm just catching up on this -- to confirm and make sure our PRs are cross-linked correctly, this ended up actually being resolved by #49326 correct? (Since the original PR was reverted)?

@lukeelmers I noticed in the 7.4.2 release notes that this appears to have been fixed. Let me upgrade my cluster quickly and I can verify.

I can confirm that this is now fixed in 7.4.2.

IGNORE THE ABOVE ^^^ I made a mistake.

I'm still seeing this problem in 7.4.2 (with a dashboard updated from 7.4.0). #48106 was (mostly) fixed, which affects the expanded document view.

This bug is about relative URLs not being rendered as URLs in the table visualization. I'm still seeing this for a Number value. The label is always renders as the raw URL string instead of {{value}} and the link is not clickable.

Hi I'm testing port from 6x versions to 7x this will be an issue to me because I had the same problem at Kibana 7.4.2.

I just tested 7.4.2 and unfortunately my original test case is still NOT rendered correctly:

Screen Shot 2019-11-29 at 5 07 00 PM

Per my screenshot of 6.5.4 at the very beginning of this issue, this visualization should render as a list of clickable IP addresses.

Please let me know if I can provide any further information to help get this issue properly resolved.

Thanks!

Since my original test case has not been resolved, could somebody re-open this issue?

Or do I need to create a new issue?

Per @dougburks note that this issue is not resolved, I've re-opened this issue.

@kevinkeeneyjr @Jaraxal for visibility

I am going to reevaluate/retest this as well.

Just tested Kibana 7.5.0 and confirmed this issue still exists there:

Kibana-bug-7 5 0

As always, please let me know if I can provide any further information to help get this issue properly resolved.

Thanks!

This is still broken for me in 7.5.2. I've put a better fix in place directly in the UrlFormat class that seems to fix this, however I also see a similar fix already done in master.

How soon will we get the next version with the fix in master? Shall I submit a PR in the meantime if there's going to be a 7.5.3?

@mike-treadway thanks for letting us know. The user who opened this issue actually told me today that this PR actually helped fix the issue.

This is still broken for me in 7.5.2

To avoid assumptions, can you please elaborate more on what do you mean by still broken

Sure. When we configure a relative URL for a field in an index, the field just renders as text (the relative url is the text) on our dashboard. If I change the field to an absolute URL, it renders as a link with the original field value as the text of the link (which is expected).

The problem is that in the context of getting the formatter, it's not able to send the parsedUrl parameter to the formatter. So when the formatter doesn't see the URL start with http and it doesn't have a parsedUrl parameter, it just returns a <span>URL TEXT<span> instead of an href within the span.

If you'd like, I can commit the change in my fork if you want to review. I just attempted to test what's in master and it looks like you guys are gearing up for v8.

image

Interesting. I only tested 7.5.2 for a few minutes this morning but it seemed to be working correctly for the few test cases I looked at. Perhaps there is some other corner case somewhere that I didn't test though. I'll try to re-test as time allows.

It only seems to work when the mapping is for a terms field (i.e. the mapping id was terms) and falls into this case:

https://github.com/elastic/kibana/blob/v7.5.2/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts#L131

In my situation, the mapping was of type url and was falling into the default case:

https://github.com/elastic/kibana/blob/v7.5.2/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts#L156

where the field formatter never gets a parsedUrl parameter.

This issue was fixed in #53265, which was merged into master and 7.6. However, due to some large refactoring that has been happening as we work on migrating core Kibana plugins to our new platform, it wasn't feasible to apply the same change to the 7.5 branch as it had diverged too far from master. As a result, a one-off fix was applied directly to 7.5 to ensure the issue would still be addressed in 7.5.2 (#53789).

The one-off fix released in 7.5.2 resolved the use case that @dougburks originally described in this issue, but not the additional case @mike-treadway has found.

The long-term fix which is on master should address both cases in the 7.6 release, which will be coming sometime in the near term.

@mike-treadway Just to triple-check, would you be able to confirm that everything is working as expected for you in the 7.6 branch?

Was this page helpful?
0 / 5 - 0 ratings