strcat_delim function concatenates between 2 and 64 arguments with a specified delimiter between each argument. Use this function to build delimited strings like CSV rows, create formatted lists, or join fields with consistent separators.
For users of other query languages
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.Splunk SPL users
Splunk SPL users
In Splunk SPL, you typically concatenate with repeated delimiters. APL’s
strcat_delim provides a more concise approach.ANSI SQL users
ANSI SQL users
In ANSI SQL, you use
CONCAT_WS (concat with separator) for delimited concatenation. APL’s strcat_delim provides similar functionality.Usage
Syntax
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| delimiter | string | Yes | The separator string to insert between arguments. |
| arg1, arg2, …, argN | any | Yes | Between 2 and 64 expressions to concatenate. Non-string values are converted to strings. |
Returns
Returns all arguments concatenated with the delimiter between each argument.Use case examples
- Log analysis
- OpenTelemetry traces
- Security logs
Create CSV-formatted log records for export or integration with external systems.QueryRun in PlaygroundOutput
This query formats log fields as CSV records with comma delimiters, making them ready for export to spreadsheet applications or data warehouses.
| _time | csv_record |
|---|---|
| 2024-11-06T10:00:00Z | GET,200,/api/users,145,United States |
| 2024-11-06T10:01:00Z | POST,201,/api/orders,234,United Kingdom |
List of related functions
- strcat: Concatenates strings without delimiters. Use this when you want direct concatenation or need custom separators for each position.
- split: Splits strings by delimiters. Use this to reverse strcat_delim operations and extract individual fields.
- parse_csv: Parses CSV strings. Use this to parse the output of strcat_delim with comma delimiters.
- format_url: Formats URLs from components. Use this specifically for URL construction rather than general delimited concatenation.