# How convert Hashmap to JSON string in painless script?

**URL:** <https://discuss.elastic.co/t/how-convert-hashmap-to-json-string-in-painless-script/291812>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [December 14, 2021, 2:20pm UTC](https://discuss.elastic.co/t/how-convert-hashmap-to-json-string-in-painless-script/291812 "2021-12-14T14:20:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [December 14, 2021, 2:20pm UTC](https://discuss.elastic.co/t/how-convert-hashmap-to-json-string-in-painless-script/291812/1 "2021-12-14T14:20:22Z")

</div>

Hi , this is very same question : [How convert Hashmap to JSON string in painless script?](https://discuss.elastic.co/t/how-convert-hashmap-to-json-string-in-painless-script/107994)

Just checking is this possible in Logstash 7.x?  
Mostly wanted to convert a hashmap format to pure JSON for output purposes

---

<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:** [January 11, 2022, 2:21pm UTC](https://discuss.elastic.co/t/how-convert-hashmap-to-json-string-in-painless-script/291812/2 "2022-01-11T14:21:13Z")

</div>

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