Field Modifiers
The following modifiers allow you to transform field values for output.
Length Limit
Add a number as a modifier to limit a formatted field’s maximum length (in bytes).
| The length is in bytes (not symbols). It is important for non-ASCII encodings. |
If {MESSAGE} equals Abcdef, {MESSAGE|3} produces Abc.
Use Cases
In addition to meeting the obvious requirement for maximum field length in data exports, the length modifier also improves filter performance. For example, if you are searching for a keyword in the message text and know it is somewhere at the beginning, adding a length limit will significantly increase the filter performance.
Not optimized filter expression: {MESSAGE} CONTAINS "keyword"
Better performance: {MESSAGE|50} CONTAINS "keyword"
UPPER / lower
Syslog Watcher provides two modifiers to convert the casing of a field text: UPPER and lower.
If {MESSAGE} equals Abc, {MESSAGE|UPPER} produces ABC
If {MESSAGE} equals Abc, {MESSAGE|lower} produces abc