# Split rabbitmq.connection.name field to visualize

**URL:** <https://discuss.elastic.co/t/split-rabbitmq-connection-name-field-to-visualize/207713>\
**Category:** Kibana\
**Created:** [November 13, 2019, 1:30pm UTC](https://discuss.elastic.co/t/split-rabbitmq-connection-name-field-to-visualize/207713 "2019-11-13T13:30:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstroSlazak](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@AstroSlazak](https://discuss.elastic.co/u/AstroSlazak)\
**Post date:** [November 13, 2019, 1:30pm UTC](https://discuss.elastic.co/t/split-rabbitmq-connection-name-field-to-visualize/207713/1 "2019-11-13T13:30:48Z")

</div>

Hi  
I want to create a Sankey visualization in Kiban using rabbitmq.connection.name from metricbeat .  
I get the data like this:

> 10.149.100.111:42708 -\> 192.168.112.19:5672

but i need it to be like this:

> 10.149.100.111:42708  
> 192.168.232.112:5672

How can i use regex for it ?

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [November 14, 2019, 5:58pm UTC](https://discuss.elastic.co/t/split-rabbitmq-connection-name-field-to-visualize/207713/2 "2019-11-14T17:58:57Z")

</div>

You can create two scripted fields in your index pattern in Kibana. For example:

````auto
String target = doc['rabbitmq.connection.name'].value;
int index = target.indexOf(' ', 0);
if (index === -1) {
  return target.substring(0, target.length());
}
return target.substring(0, index);```
````

---

<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:** [December 12, 2019, 5:58pm UTC](https://discuss.elastic.co/t/split-rabbitmq-connection-name-field-to-visualize/207713/3 "2019-12-12T17:58:59Z")

</div>

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