# Using settings from elasticsearch.yml in a plugin

**URL:** <https://discuss.elastic.co/t/using-settings-from-elasticsearch-yml-in-a-plugin/235322>\
**Category:** Elasticsearch\
**Created:** [June 2, 2020, 11:25am UTC](https://discuss.elastic.co/t/using-settings-from-elasticsearch-yml-in-a-plugin/235322 "2020-06-02T11:25:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulkarajgikar](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@rahulkarajgikar](https://discuss.elastic.co/u/rahulkarajgikar)\
**Post date:** [June 2, 2020, 11:25am UTC](https://discuss.elastic.co/t/using-settings-from-elasticsearch-yml-in-a-plugin/235322/1 "2020-06-02T11:25:42Z")

</div>

Hi,

I'm creating a plugin that blacklists certain API calls. Right now I've created a .yml file in the src/main/resources directory of my project, where I read the blacklisted APIs from.  
The problem is, if I want to add more blacklisted API's to the list, I have to remove the plugin, change the yml file, rebuild and reinstall the plugin. I'd like my plugin to be able to read directly from elasticsearch.yml, so that I don't have to do this. Is this possible?  
Any suggestions would be greatly appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 2, 2020, 1:17pm UTC](https://discuss.elastic.co/t/using-settings-from-elasticsearch-yml-in-a-plugin/235322/2 "2020-06-02T13:17:09Z")

</div>

It's possible. You need to declare some settings for that.

Here is an example of settings:

> <https://github.com/elastic/elasticsearch/blob/master/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java>

And how you declare them in the plugin:

> <https://github.com/elastic/elasticsearch/blob/5b454000755dc4c8c1c8cdce78656facf751d6d0/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2DiscoveryPlugin.java#L104-L126>

HTH

---

<div class="post-metadata">

**Author:** ![rahulkarajgikar](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@rahulkarajgikar](https://discuss.elastic.co/u/rahulkarajgikar)\
**Post date:** [June 2, 2020, 1:28pm UTC](https://discuss.elastic.co/t/using-settings-from-elasticsearch-yml-in-a-plugin/235322/3 "2020-06-02T13:28:52Z")

</div>

Thanks a lot! This is exactly what I needed

---

<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:** [June 30, 2020, 1:28pm UTC](https://discuss.elastic.co/t/using-settings-from-elasticsearch-yml-in-a-plugin/235322/4 "2020-06-30T13:28:53Z")

</div>

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