Skip to main content

Dot Case

Text Processing String Manipulation

Synopsis

Converts strings to dot.case format.

Schema

- dotcase:
field: <ident>
target_field: <ident>
fields: <array>
exclude: <array>
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:

FieldRequiredDefaultDescription
fieldN-Selects value mode: converts the value of this field to dot.case. The value must be a string or an array of strings. Mutually exclusive with fields — when field is set, fields and exclude are ignored
target_fieldNSame as fieldWhere the converted value is written in value mode. Ignored in name mode
fieldsN["*"]Selects name mode: glob patterns matching field names to rename to dot.case. The values are left untouched. a.* renames the keys inside object a, *.* those of every root object. Omitting both field and fields renames every root-level field name; names beginning with _ are never renamed
excludeN-Field names to leave alone in name mode. Has no effect in value mode
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseContinue processing if conversion fails
ignore_missingNfalseSkip processing if referenced 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

Details

Converts string values to dot.case format by replacing spaces, hyphens, underscores, and other separators with dots, then converting all characters to lowercase. This format is commonly used in configuration files, namespacing, and object notation.

The processor handles various input formats and normalizes them to the consistent dot.case style with lowercase letters separated by dots.

note

dot.case format uses dots as separators and converts all text to lowercase, resulting in format like "user.name", "api.response.data", or "system.config.value".

The processor preserves the logical word boundaries from the input while standardizing the format for consistent usage in configuration systems or hierarchical naming.

warning

Excessive dots or special characters in the input may result in multiple consecutive dots in the output. The processor does not automatically clean up redundant separators.

Examples

Basic Conversion

Converting field name to dot.case...

{
"field_name": "user_account_settings"
}
- dotcase:
field: field_name
target_field: dot_name

converts to dot notation:

{
"field_name": "user_account_settings",
"dot_name": "user.account.settings"
}

Mixed Separators

Normalizing mixed separators to dots...

{
"config_key": "api-response_data with spaces"
}
- dotcase:
field: config_key

standardizes all separators to dots:

{
"config_key": "api.response.data.with.spaces"
}

Configuration Namespace

Creating configuration namespace format...

{
"service_name": "User Authentication Service"
}
- dotcase:
field: service_name
target_field: namespace

creates namespace-style identifier:

{
"service_name": "User Authentication Service",
"namespace": "user.authentication.service"
}

Multiple Fields

Converting multiple fields to dot.case...

{
"module_name": "data_processor",
"component_type": "log-parser",
"version_info": "v1_2_3"
}
- dotcase:
fields: ["module_name", "component_type", "version_info"]

renames the matched names; the values are unchanged:

{
"module.name": "data_processor",
"component.type": "log-parser",
"version.info": "v1_2_3"
}