# Adding custom config in kibana.yml

**URL:** <https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899>\
**Category:** Kibana\
**Created:** [January 8, 2017, 9:13pm UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899 "2017-01-08T21:13:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [January 8, 2017, 9:13pm UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/1 "2017-01-08T21:13:01Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [January 8, 2017, 9:18pm UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/2 "2017-01-08T21:18:49Z")

</div>

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']();
},
```

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [January 9, 2017, 5:44pm UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/3 "2017-01-09T17:44:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [January 10, 2017, 6:11am UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/4 "2017-01-10T06:11:32Z")

</div>

Yes the name is set to customplugin.

---

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [January 10, 2017, 6:13am UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/5 "2017-01-10T06:13:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [January 10, 2017, 5:34pm UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/6 "2017-01-10T17:34:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![soodlikesjava](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@soodlikesjava](https://discuss.elastic.co/u/soodlikesjava)\
**Post date:** [January 15, 2017, 1:38am UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/7 "2017-01-15T01:38:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 12, 2017, 1:39am UTC](https://discuss.elastic.co/t/adding-custom-config-in-kibana-yml/70899/8 "2017-02-12T01:39:17Z")

</div>

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