# Logstash Java hashSetting Syntax

**URL:** <https://discuss.elastic.co/t/logstash-java-hashsetting-syntax/217317>\
**Category:** Logstash\
**Created:** [January 31, 2020, 8:14am UTC](https://discuss.elastic.co/t/logstash-java-hashsetting-syntax/217317 "2020-01-31T08:14:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Mahy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tom_mahy/32/8695_2.png) [@Tom\_Mahy](https://discuss.elastic.co/u/Tom_Mahy)\
**Post date:** [January 31, 2020, 8:14am UTC](https://discuss.elastic.co/t/logstash-java-hashsetting-syntax/217317/1 "2020-01-31T08:14:12Z")

</div>

Hello,

We are currently in the process of writing a JAVA based logstash plugin  
We can easily set custom properties in the logstash config and read them inside our class

But we cant get the maps to work

ie:  
// public static final PluginConfigSpec\<Map\<String, Object\>\> CONFIG\_CUSTOM\_METADATA = PluginConfigSpec.hashSetting(PROPERTY\_CUSTOM\_METADATA, new HashMap\<String, Object\>(), false, false);

We have the following property in the pipeline.conf  
customMetadata =\> {"[https://biodiversity.europa.eu/":["BISE](https://biodiversity.europa.eu/%22:%5B%22BISE)", "Biodiversity Information System Europe", "Biodiversity"]}

But its giving us an error that the json syntax is not correct.

What is the correct json syntax for maps ?

The full code is on github

> <https://github.com/wajja/logstash-filters/blob/master/logstash-filter-europaplugin/src/main/java/eu/wajja/filter/EuropaPlugin.java>

Thank you

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [February 3, 2020, 9:46am UTC](https://discuss.elastic.co/t/logstash-java-hashsetting-syntax/217317/2 "2020-02-03T09:46:41Z")

</div>

Hi Tom,

For map settings you need to use the usual "hash" notation used elsewhere in the logstash pipeline, with `=>` instead of colons:

```auto
customMetadata => { "https://biodiversity.europa.eu/" => ["BISE", "Biodiversity Information System Europe", "Biodiversity"]}

```

---

<div class="post-metadata">

**Author:** ![Tom\_Mahy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tom_mahy/32/8695_2.png) [@Tom\_Mahy](https://discuss.elastic.co/u/Tom_Mahy)\
**Post date:** [February 4, 2020, 9:41am UTC](https://discuss.elastic.co/t/logstash-java-hashsetting-syntax/217317/3 "2020-02-04T09:41:02Z")

</div>

That works great.

Thank you.

---

<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:** [March 3, 2020, 9:41am UTC](https://discuss.elastic.co/t/logstash-java-hashsetting-syntax/217317/4 "2020-03-03T09:41:14Z")

</div>

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