# Limit length in visualization

**URL:** <https://discuss.elastic.co/t/limit-length-in-visualization/113909>\
**Category:** Kibana\
**Created:** [January 3, 2018, 11:02am UTC](https://discuss.elastic.co/t/limit-length-in-visualization/113909 "2018-01-03T11:02:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitabrev](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mitabrev](https://discuss.elastic.co/u/mitabrev)\
**Post date:** [January 3, 2018, 11:02am UTC](https://discuss.elastic.co/t/limit-length-in-visualization/113909/1 "2018-01-03T11:02:42Z")

</div>

Hi all,

First happy new year!

One question.  
Can I limit the length of a string in table data output? Column A is a string term, column B is count of events. As there are some terms which are slightly different, I'd like to group them.

For example:  
So instead of the rows of 13033197350, 13033197351, 13033197352 I want one "130331" with a sum count of all three.

Is this possible?

Thank you and best regards,  
Mario

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [January 3, 2018, 6:30pm UTC](https://discuss.elastic.co/t/limit-length-in-visualization/113909/2 "2018-01-03T18:30:28Z")

</div>

hi @mitabrev,

you could look into using scripted fields: [https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

You can write a little script that truncates that value. That result is then the value for a new "scripted field". Then, you can run any other ES-query against that new field.

---

<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 31, 2018, 6:30pm UTC](https://discuss.elastic.co/t/limit-length-in-visualization/113909/3 "2018-01-31T18:30:41Z")

</div>

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