Hi There,
I want to add a link in side-navigation of Kibana 6.2. The URL of the link needs to be taken from kibana.yml (dashboard.defaultAppId).
Thanks in advance for the help!
Regards,
Dhiraj
Hi There,
I want to add a link in side-navigation of Kibana 6.2. The URL of the link needs to be taken from kibana.yml (dashboard.defaultAppId).
Thanks in advance for the help!
Regards,
Dhiraj
You would need to develop a custom plugin to accomplish this. This guide is a good starting point for that: https://www.elastic.co/guide/en/kibana/current/plugin-development.html
Thanks for your reply Bill.
I've already developed a plugin. I am able to add a button in side-nav:
uiExports: {
links: [
{
id: 'kibana:home_dashboard',
title: 'Home',
order: -1004,
url: `${kbnBaseUrl}#${appId}`,
description: 'Home button',
}
]
]
}
...........
...........
}
But the problem is I am not able to get the value from kibana.yml and set in the url.
Sorry, misunderstood your question. An example of how to read the configuration can be found here:
var appId; // This needs to be configurable.
export default function (kibana) {
var kibanaPluginObj = {
name: 'test',
require: ['elasticsearch'],
config: function (Joi) {
var obj = Joi.object({
enabled: Joi.boolean().default(true),
keycloak: Joi.boolean().default(false),
proxydomain: Joi.string(),
password: Joi.string().default('x?23^zH2sdfdfsCZpS%deEf=784^NgJ')
}).default();
return obj;
},
uiExports: {
links: [
{
id: 'kibana:home_dashboard',
title: 'Home',
order: -1004,
url: `${kbnBaseUrl}#${appId}`, // appId is undefined here. I think UI Exports getting executed before the init() method perhaps.
description: 'Home button',
}
]
},
init(server, options) {
try {
const serverConfig = server.config();
**appId = serverConfig.get('kibana.defaultAppId'),**
}
catch (err) {
this.status.red('Exception while checking config');
}
}
}
return new kibana.Plugin(kibanaPluginObj);
}
In init() method I am able to get the value from kibana.yml (kibana.defaultAppId) but I am still not able to set it to the url in the link object up above.
© 2020. All Rights Reserved - Elasticsearch
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.