Adding custom config in kibana.yml


(Sushant Sood) #1

Hi Team,
I am trying to add a custom config in kibana.yml for my custom plugin , but kibana fails and says unknown config key on load of the plugin .

In plugin ,can kibana take my config schema from config object of Kibana.Plugin({config:}), as it is not working but i dont want to change the schema.js of kibana .

Please suggest .


(Sushant Sood) #2

currently in my plugin index.js , i am configuring the injectedVars like below and there it fails :

return new kibana.Plugin({
require: ['kibana'],
name: 'customplugin',

uiExports: {
  app: {
    title: 'customplugin',
    description: 'customplugin for Kibana',
    main: 'plugins/custom/custom',
    injectVars: function (server, options) {
      var config = server.config();
      return {
        kbnIndex: config.get('kibana.index'),
        esApiVersion: config.get('elasticsearch.apiVersion'),
        custom_config: config.get('customplugin.url')
      };
    }
  }, 

config: function (Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),

    url: Joi.string().uri({ scheme: ['http', 'https'] })['default']('https://localhost:8443')
  })['default']();
},

(Jon Budzenski) #3

In your plugin's package.json, is name set to customplugin?


(Sushant Sood) #4

Yes the name is set to customplugin.


(Sushant Sood) #5

But not in package.json , name is matching only in index.js


(Jon Budzenski) #6

Does using the name set in the package.json work? Looking at the code I believe that's where it's being pulled from.


(Sushant Sood) #7

Hi @jbudz , ya its working but little bit wierd , what is the significance of keeping name inside the kibana.Plugin then ?


(system) #8

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