Truncate Scripted Field

I have a text field that I'd like to truncate to the first 5 characters. The Truncate String option doesn't seem to do what I thought. Could someone recommend anything here?

You can use a field formatter, available in Management > Index Patterns. Open the index pattern with the field you'd like to modify, find the field (use the search at the top if you have several), and click the edit button on the right. In there, set the format to "Truncated String" and tell it how many characters to show.

The only drawback is that this formatter will be used any time the value of that field is displayed.

Alternatively, you could re-index your data, adding a new field that is the truncated version of the original field, and use that new field in Kibana.

2 Likes

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