Skip to main content

trim Search Operator

The trim operator eliminates leading and trailing spaces from a string field.

Syntax

trim(<field>) as <field>
trim(" <string expression> ") as <field>

Example

Take the string value " Hello World  ". To remove the leading and trailing spaces you'd do the following:

| trim(" Hello World  ") as greeting

This would return a field named greeting with a new value of "Hello World".

Sumo Logic YouTubeSumo Logic Twitter
Legal
Privacy Statement
Terms of Use

Copyright © 2022 by Sumo Logic, Inc.