# Count string field in Kibana

**URL:** <https://discuss.elastic.co/t/count-string-field-in-kibana/63811>\
**Category:** Kibana\
**Created:** [October 25, 2016, 12:08am UTC](https://discuss.elastic.co/t/count-string-field-in-kibana/63811 "2016-10-25T00:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeeptengli](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@sandeeptengli](https://discuss.elastic.co/u/sandeeptengli)\
**Post date:** [October 25, 2016, 12:08am UTC](https://discuss.elastic.co/t/count-string-field-in-kibana/63811/1 "2016-10-25T00:08:00Z")

</div>

I want to count the string field if it matches regex.

Ex: "mappings": { "test": { "properties": { "id1": { "type": "string" }, "payload": { "type": "string" }, "id2": { "type": "string" }, "timestamp": { "format": "strict\_date\_optional\_time||epoch\_millis", "type": "date" } } } }

Count only if payload matches [a-zA-Z]\*

I want to create a table with the field, so where exactly should I add a query or a script?

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [October 25, 2016, 4:35pm UTC](https://discuss.elastic.co/t/count-string-field-in-kibana/63811/2 "2016-10-25T16:35:13Z")

</div>

normally this is done by "splitting rows" on a filter, and then using the count metric.

Is that sufficient for your use case?

---

<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:** [July 6, 2017, 1:35pm UTC](https://discuss.elastic.co/t/count-string-field-in-kibana/63811/3 "2017-07-06T13:35:43Z")

</div>


