Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fstring%2Fconcat.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fstring%2Fconcat.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `concat`

## Description

Joins multiple strings together and return the result as a single string.

## Syntax

Like many functions in DataPrime, `concat` supports<!-- --> [two notations](https://coralogix.com/docs/docs/dataprime/language-reference/functions-reference/.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
concat(value: string, ...values: string): string
```

```
(value: string).concat(...values: string): string
```

## Arguments

| Name        | Type     | Required | Description                                 |
| ----------- | -------- | -------- | ------------------------------------------- |
| `value`     | `string` | **true** | The first string to include in the result   |
| `...values` | `string` | **true** | Additional strings to concatenate, in order |

## Example 1

**Combine first and last names into a full name.**

Use `concat` to build a `full_name` field:

```
{

    "username": "prime4u",

    "first_name": "Rick",

    "last_name": "Ast",

}
```

### Example query

* Function notation
* Method notation

```
create full_name from concat(first_name, ' ', last_name)
```

```
create full_name from first_name.concat(' ', last_name)
```

### Example output

```
{

    "username": "prime4u",

    "first_name": "Rick",

    "last_name": "Ast",

    "full_name": "Rick Ast"

}
```

## Example 2

**Use case 2: Build an Amazon ARN**

```
{

    "aws": {

        "region": "eu-west-1",

        "instance_id": "i-02084e96d21517df8",

        "account_number": 74157727657

    }

}
```

Amazon ARNs follow the format:

```
arn:aws:ec2:<region>:<account-number>:instance/<instance-id>
```

Use `concat` to construct the ARN:

### Example query

```
create aws.instance_arn from concat('arn:aws:ec2:', aws.region, ':', aws.account_number, ':instance/', aws.instance_id)
```

### Example output

```
{

    "aws": {

        "region": "eu-west-1",

        "instance_id": "i-02084e96d21517df8",

        "account_number": 74157727657,

        "instance_arn": "arn:aws:ec2:eu-west-1:74157727657:instance/i-02084e96d21517df8"

    }

}
```
