# How to move elasticsearch text to next line

**URL:** <https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203>\
**Category:** Kibana\
**Created:** [November 7, 2016, 10:46am UTC](https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203 "2016-11-07T10:46:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudarshan](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@sudarshan](https://discuss.elastic.co/u/sudarshan)\
**Post date:** [November 7, 2016, 10:46am UTC](https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203/1 "2016-11-07T10:46:19Z")

</div>

Hello,

I have a field in elasticsearch that is very lengthy. So while visualizing that field I am getting the whole value in a straight line which is looking awkward. So I want to split that line into two lines(i.e; separated by \n in the middle).  
So how would I achieve that using elasticsearch to be able to visualize it better in Kibana.

---

<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:** [November 7, 2016, 4:18pm UTC](https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203/2 "2016-11-07T16:18:06Z")

</div>

If you are on Kibana 5.0, you could look into '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 formatter function that truncated the line or splits it with a line-break (using HTML `<br/>` tag).

---

<div class="post-metadata">

**Author:** ![sudarshan](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@sudarshan](https://discuss.elastic.co/u/sudarshan)\
**Post date:** [November 8, 2016, 5:13am UTC](https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203/3 "2016-11-08T05:13:36Z")

</div>

Hi Thomas,

Thanks for the reply 🙂

In the scripted fields I can see that it works only for numeric values, but I have a String field. If so we can do that, will you be kind in helping me how to do that?

Thanks,  
Sudarshan.

---

<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:** [November 8, 2016, 11:57pm UTC](https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203/4 "2016-11-08T23:57:46Z")

</div>

What version of Kibana are you on?

Before 4.0, you can only use scripts for numerical values indeed. But from 5.0 on, you can write scripts for Strings. You would select 'Painless' as your language. And then it would look something like:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/a32048a4b24642198f62674acc94905de6fd21b3.png)

---

<div class="post-metadata">

**Author:** ![sudarshan](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@sudarshan](https://discuss.elastic.co/u/sudarshan)\
**Post date:** [November 9, 2016, 7:23pm UTC](https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203/5 "2016-11-09T19:23:02Z")

</div>

I'm on kibana 4.5.4.  
I think I should upgrade in order to use that feature. Thanks Thomas.

---

<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 7, 2016, 7:23pm UTC](https://discuss.elastic.co/t/how-to-move-elasticsearch-text-to-next-line/65203/6 "2016-12-07T19:23:15Z")

</div>

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