Random String
Synopsis
Generates random strings with specified length and character sets.
Schema
- random_string:
field: <ident>
length: <integer>
charset: <string>
target_field: <string>
prefix: <string>
suffix: <string>
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 | - | Target field to store the generated random string |
length | Y | - | Length of the random string to generate |
charset | N | alphanumeric | Character set: alphanumeric , alpha , numeric , hex , custom |
target_field | N | Same as field | Target field to store result |
prefix | N | - | Static prefix to prepend to random string |
suffix | N | - | Static suffix to append to random string |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if generation fails |
ignore_missing | N | false | Skip processing if referenced field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
Generates cryptographically secure random strings using specified character sets and length requirements. This processor is useful for creating unique identifiers, tokens, passwords, or test data.
The processor supports various predefined character sets and allows custom character sets for specific requirements. Generated strings are suitable for security-sensitive applications.
The processor uses cryptographically secure random number generation to ensure unpredictability of the generated strings. This makes them suitable for security tokens and identifiers.
The prefix
and suffix
options allow you to add static text before and after the random portion, which is useful for creating formatted identifiers or tokens with specific patterns.
Generating very long random strings (>10000 characters) may impact performance. Consider using reasonable lengths for production workloads.
Examples
Basic Random String
Generating a 10-character alphanumeric string... |
|
adds random session identifier: |
|
Hexadecimal Token
Creating a hexadecimal token... |
|
generates hex token: |
|
Formatted Identifier
Creating formatted ID with prefix/suffix... |
|
creates formatted transaction ID: |
|
Numeric PIN
Generating numeric PIN code... |
|
creates numeric verification code: |
|
Alphabetic Code
Creating alphabetic reference code... |
|
generates alphabetic reference: |
|