String functions
Convert string to lowercase.
Convert string to uppercase.
Check if string contains substring.
Check if string starts with prefix.
Check if string ends with suffix.
Remove leading and trailing whitespace.
Remove prefix from string.
Remove suffix from string.
Replace all occurrences of old with new.
Get length of string or array.
Concatenate multiple strings.
Encoding functions
Base64 encode string.
Base64 decode string.
URL encode string.
URL decode string.
HTML encode string.
HTML decode string.
Hex encode string.
Hex decode string.
Hashing functions
Calculate MD5 hash.
Calculate SHA1 hash.
Calculate SHA256 hash.
Calculate SHA512 hash.
Calculate MurmurHash3 hash.
Regex functions
Check if input matches regex pattern.
Numeric functions
Generate random integer between min and max.
Get current Unix timestamp.
Random data functions
Generate random alphanumeric string of specified length.
Generate random alphanumeric text.
Generate random alphabetic text.
Generate random numeric text.
Generate random base64 encoded string.
Response data functions
HTTP response status code.
HTTP response content length.
Request duration in milliseconds.
HTTP response body.
HTTP response headers as map.
All HTTP response headers concatenated.
Real-world examples
Combining functions
Helper functions can be nested and combined:Best practices
- Use appropriate functions - Choose the right function for the task (e.g.,
contains()vsregex()) - Chain functions efficiently - Combine functions to avoid multiple operations
- Validate before transforming - Check data exists before applying transformations
- Use case-insensitive comparisons - Apply
to_lower()orto_upper()for reliable matching - Cache expensive operations - Store computed values in variables
- Test DSL expressions - Verify complex DSL logic with known inputs
- Document complex logic - Add comments for non-obvious DSL expressions
Common patterns
Validate and extract
Normalize and compare
Multiple conditions
Hash-based detection
Performance considerations
Function categories
- String
- Encoding
- Hashing
- Random
- Utility
to_lower,to_uppercontains,starts_with,ends_withtrim,trim_prefix,trim_suffixreplace,concat,len
Related
Matchers
Using DSL in matchers
Extractors
Using DSL in extractors
Variables
Computing variables
Flow Control
JavaScript vs DSL