Skip to main content
Sumo Logic


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


  • trim(fieldname) as field1
  • trim(" string expression ") as field1


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

| trim(" Hello World  ") as field1

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