# Hot to concatenate custom string in aggregate map variable

**URL:** <https://discuss.elastic.co/t/hot-to-concatenate-custom-string-in-aggregate-map-variable/150856>\
**Category:** Logstash\
**Created:** [October 3, 2018, 10:19am UTC](https://discuss.elastic.co/t/hot-to-concatenate-custom-string-in-aggregate-map-variable/150856 "2018-10-03T10:19:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavlik](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@pavlik](https://discuss.elastic.co/u/pavlik)\
**Post date:** [October 3, 2018, 10:19am UTC](https://discuss.elastic.co/t/hot-to-concatenate-custom-string-in-aggregate-map-variable/150856/1 "2018-10-03T10:19:21Z")

</div>

Hi,

I'm not able to write a working code for the aggregate plugin that would allow me just to add some custom strings between existing message fields. The following one is working properly:

`map['dns_result'] = [map['from_ip'], map['query'].strip, map['status'], map['response'].strip].join(' '); event.set('dns_result', map['dns_result']);`

But I would like to have something like this:

`map['dns_result'] = ["Query":, map['from_ip'], map['query'].strip, "Response:" map['status'],map['response'].strip].join(' '`);  
How can I properly insert some custom string in the map variable? Please help.  
PaVliK

---

<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:** [October 31, 2018, 10:19am UTC](https://discuss.elastic.co/t/hot-to-concatenate-custom-string-in-aggregate-map-variable/150856/2 "2018-10-31T10:19:29Z")

</div>

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