I'm using 7.5.1 ELK stack and trying to build a dashboard for our CI pipelines. I'm focusing on visualizing SonarQube quality gate data, especially highlighting error counter when code issues are detected.
I'm using a painless scripted field in Kibana to do a basic sum over json fields to detect failures:
...
for (int i = 0; i < params['_source']['component']['measures'][0]['value']['conditions'].length ; i++) {
gateFailedCount += params['_source']['component']['measures'][0]['value']['conditions'][i]['failure'];
...
}
This is working as expected and I can build Metric visualization based on this scripted field.
Now I would like to make this metric (e.g. 2 gate_failures) clickable so that users can go to the matching SonarQube url.
the Metric visualisation get messed up: the whole <a href ...> string is used as display text without any hyperlink. Looking at the DOM, the < and > symbol have been transformed into a < and > which explain the issue.
I also tried to declare the scripted field as a url format but could not make this work.
If I return only the URL I indeed get a clickable link but I loose the gateFailedCount information.
I would to combine both: displaying the count as the anchor and the hyperlink to the sonarqube server. Something equivalent to <a href="http://...>2</a>
Unfortunately that's not possible today with a scripted field. You could probably get something like that with a custom field formatter which you can load through a custom plugin or you'll have to split the field into two (the label, and the link).
There are a few related open issues in the Kibana repo that have a similar ask so it's definitely on the team's radar as something people want.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.