# Filter out short strings

**URL:** <https://discuss.elastic.co/t/filter-out-short-strings/160574>\
**Category:** Kibana\
**Created:** [December 12, 2018, 3:43pm UTC](https://discuss.elastic.co/t/filter-out-short-strings/160574 "2018-12-12T15:43:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adave](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@adave](https://discuss.elastic.co/u/adave)\
**Post date:** [December 12, 2018, 3:43pm UTC](https://discuss.elastic.co/t/filter-out-short-strings/160574/1 "2018-12-12T15:43:44Z")

</div>

When I create a data table to visualize top terms by count, I want to exclude strings that are \<4 characters.

Visualization, +, Data Table  
select index  
Metrics: default Count  
Buckets: Split Rows, Aggregation: Terms, Field, SearchTerms, Order By metric: Count, Order Descend, Size 5

Now I want to hide SearchTerms with string length \<4. The SearchTerms are from a split{} in a mutate plugin, so I can't easily create the length using the ruby plugin.

How can I do this?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![adave](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@adave](https://discuss.elastic.co/u/adave)\
**Post date:** [December 12, 2018, 4:19pm UTC](https://discuss.elastic.co/t/filter-out-short-strings/160574/2 "2018-12-12T16:19:18Z")

</div>

After some searching, I found the easiest way is to:

1. click Advanced
2. In "Exclude" field use "Regular Expression Syntax" ([https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html#regexp-syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html#regexp-syntax))

Example: to exclude strings with less that 4 characters, the Exclude value would be  
.{1,3}

---

<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 9, 2019, 4:19pm UTC](https://discuss.elastic.co/t/filter-out-short-strings/160574/3 "2019-01-09T16:19:24Z")

</div>

Closed on January 9, 2019, 4:19pm UTC

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