# Add Scripted Field in Kibana to Count Characters of a field and add show the count in another field

**URL:** <https://discuss.elastic.co/t/add-scripted-field-in-kibana-to-count-characters-of-a-field-and-add-show-the-count-in-another-field/175109>\
**Category:** Elasticsearch\
**Created:** [April 3, 2019, 7:01am UTC](https://discuss.elastic.co/t/add-scripted-field-in-kibana-to-count-characters-of-a-field-and-add-show-the-count-in-another-field/175109 "2019-04-03T07:01:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Meyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_meyer/32/43073_2.png) [@Daniel\_Meyer](https://discuss.elastic.co/u/Daniel_Meyer)\
**Post date:** [April 3, 2019, 7:01am UTC](https://discuss.elastic.co/t/add-scripted-field-in-kibana-to-count-characters-of-a-field-and-add-show-the-count-in-another-field/175109/1 "2019-04-03T07:01:17Z")

</div>

Hi Guys,

I'm just getting started with Kibana and couldn't find a Topic similar to mine.

Heres what I want to Do:

I want to add a Scripted field to the Discovery Window.

The Field should show the count of Characters is another Field that contains a String in the Value.

Any Suggestions how i can do this?

Thanks!

Daniel

---

<div class="post-metadata">

**Author:** ![John\_Guzman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_guzman/32/83587_2.png) [@John\_Guzman](https://discuss.elastic.co/u/John_Guzman)\
**Post date:** [April 25, 2019, 4:24pm UTC](https://discuss.elastic.co/t/add-scripted-field-in-kibana-to-count-characters-of-a-field-and-add-show-the-count-in-another-field/175109/2 "2019-04-25T16:24:02Z")

</div>

Look at this post: [String size limit in painless / keyword field?](https://discuss.elastic.co/t/string-size-limit-in-painless-keyword-field/108366)

You can make the same in Index Patterns - Pick your index - Scripted Fields.  
I think that code is counting the quotation marks so just add -2 to the operation.

---

<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:** [May 23, 2019, 4:24pm UTC](https://discuss.elastic.co/t/add-scripted-field-in-kibana-to-count-characters-of-a-field-and-add-show-the-count-in-another-field/175109/3 "2019-05-23T16:24:04Z")

</div>

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