Capitalize
Synopsis
A text formatting processor that capitalizes the first letter of strings while converting the remaining characters to lowercase, providing consistent sentence-case formatting for data normalization and display purposes.
Schema
- capitalize:
field: <ident>
target_field: <ident>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
Field | Required | Default | Description |
---|---|---|---|
field | Y | - | Field containing the string(s) to capitalize |
target_field | N | field | Field to store the capitalized result |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue if capitalization fails |
ignore_missing | N | false | Continue if source field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
The processor applies proper sentence-case formatting by capitalizing the first character and converting all subsequent characters to lowercase. This ensures consistent formatting regardless of the original case of the input string.
The processor supports both individual strings and string arrays, applying capitalization to each string element in the array.
Single-character strings are converted to uppercase, while longer strings receive the first-letter capitalization treatment. Empty strings are returned unchanged to maintain data integrity.
The processor handles Unicode characters correctly, ensuring proper case conversion for international text content and special characters.
The processor only works with string and string array field types. Other data types will result in processing errors.
Examples
Basic
Capitalizing simple strings... |
|
produces properly formatted text: |
|
Arrays
Capitalizing string arrays... |
|
formats all array elements: |
|
Log Level Normalization
Normalizing log levels... |
|
creates consistent log level format: |
|
Status Fields
Formatting status fields... |
|
standardizes status formatting: |
|
Single Characters
Handling single characters and short strings... |
|
properly formats short strings: |
|
Conditional
Capitalizing based on conditions... |
|
applies formatting when condition is met: |
|