Skip to main content

Uppercase

Mutate Elastic Compatible

Synopsis

Converts string values to their uppercase equivalent.

Schema

- uppercase:
field: <ident>
fields: <string[]>
exclude: <string[]>
uppercase_keys: <boolean>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
target_field: <ident>

Configuration

The following fields are used to define the processor:

FieldRequiredDefaultDescription
fieldY*-Field containing the string to convert. Required in value mode; ignored when uppercase_keys is true
uppercase_keysNfalseSwitch to key mode: uppercase the field NAMES matched by fields instead of a value
fieldsN["*"]Key mode only. Glob patterns naming the keys to rename — * for all root keys, prefix.* for the keys of one nested object. Defaults to every root key
excludeN-Key mode only. Glob patterns for keys to leave alone, applied after fields
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseSee Handling Failures
ignore_missingNfalseIf true, quietly exit if field doesn't exist
on_failureN-See Handling Failures
on_successN-See Handling Success
tagN-Identifier
disabledNfalseWhen true, the processor is skipped and the event continues to the next one. Lets you take a processor out of the path without removing its configuration
target_fieldNfieldField to store the converted value(s)

* = Either field or uppercase_keys: true must be given. With neither, the processor fails with either field or fields with uppercase_keys must be specified.

Details

The processor can handle both single string fields and arrays of strings. When processing an array, it converts each element to uppercase.

note

The processor uses the standard string uppercase conversion rules of the Go programming language, which handles Unicode characters appropriately.

warning

If the field contains non-string values, the processor will fail unless ignore_failure is set to true.

Examples

Single String

Converting the username to uppercase...

{
"username": "admin"
}
- uppercase:
field: username

capitalizes all characters:

{
"username": "ADMIN"
}

String Arrays

Processing an array of email addresses...

{
"emails": [
"email@example.com",
"admin@example.org"
]
}
- uppercase:
field: emails

converts each element:

{
"emails": [
"EMAIL@EXAMPLE.COM",
"ADMIN@EXAMPLE.ORG"
]
}

Keep Original

Storing the uppercase values in a new field...

{
"original": "value"
}
- uppercase:
field: original
target_field: uppercase

preserves the original:

{
"original": "value",
"uppercase": "VALUE"
}