Skip to main content
Version: 1.3.0

Kebab Case

Text Processing String Manipulation

Synopsis

Converts strings to kebab-case format.

Schema

- kebabcase:
field: <ident>
target_field: <string>
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-Single field to convert to kebab-case
target_fieldNSame as fieldTarget field to store kebab-case result
fieldsN-Array of fields to convert to kebab-case
excludeN-Array of fields to exclude from conversion
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

Details

Converts string values to kebab-case format by replacing spaces, underscores, dots, and other separators with hyphens, then converting all characters to lowercase. This format is commonly used in URLs, CSS classes, file names, and command-line parameters.

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

note

kebab-case format uses hyphens as separators and converts all text to lowercase, resulting in format like "user-name", "api-response-data", or "system-config-value". It's called kebab-case because the hyphens look like skewers.

The processor preserves the logical word boundaries from the input while standardizing the format for consistent usage in web development and system naming.

warning

Consecutive separators in the input may result in multiple consecutive hyphens in the output. The processor does not automatically clean up redundant separators.

Examples

Basic Conversion

Converting field to kebab-case format...

{
"component_name": "UserAccountSettings"
}
- kebabcase:
field: component_name
target_field: kebab_name

converts to kebab-case:

{
"component_name": "UserAccountSettings",
"kebab_name": "user-account-settings"
}

URL Slug Generation

Creating URL-friendly slug from title...

{
"page_title": "Getting Started with DataStream"
}
- kebabcase:
field: page_title
target_field: url_slug

creates URL-friendly identifier:

{
"page_title": "Getting Started with DataStream",
"url_slug": "getting-started-with-datastream"
}

Mixed Format Input

Normalizing mixed separators to kebab-case...

{
"field_name": "api_response.data_with spaces"
}
- kebabcase:
field: field_name

standardizes all separators to hyphens:

{
"field_name": "api-response-data-with-spaces"
}

Multiple Fields

Converting multiple fields to kebab-case...

{
"css_class": "MainNavigation",
"element_id": "user_profile_section",
"data_attribute": "click.handler.name"
}
- kebabcase:
fields: ["css_class", "element_id", "data_attribute"]

processes all specified fields:

{
"css_class": "main-navigation",
"element_id": "user-profile-section",
"data_attribute": "click-handler-name"
}