Concatenate Values in Two Fields - Example 1

Concatenate values in two fields into a single value in a new array using the concat() function

Query

logscale
concat([aidValue, cidValue], as=checkMe2)

Introduction

The concat() function concatenates (joins) the values of a list of fields into a single value in a new field. The concat() method does not change the existing fields. The new field contains the merge between the concatenated values.

In this example, the concat() function concatenates the AID (Agent ID) and CID (Customer ID) values into a single value in a new array.

Step-by-Step

  1. Starting with the source repository events.

  2. flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 0>Augment Data] result{{Result Set}} repo --> 0 0 --> result style 0 fill:#ff0000,stroke-width:4px,stroke:#000;
    logscale
    concat([aidValue, cidValue], as=checkMe2)

    Concatenates the values of the fields aidValue and cidValue into a single value in a new field named checkMe2.

    The single value contains both the Agent ID and Customer ID information. It is recommended to have a consistent format and potentially include a separator between the AID and CID to ensure, that they can be easily parsed apart, if needed later.

  3. Event Result set.

Summary and Results

The query is used to concatenate the values of a list of fields into a single value in a new field. Combining CID and AID values is, for example, useful for unique identification, troubleshooting, data analysis etc. This query is also useful in case you want to combine for example first names and last names from two different fields into the full name in a new field, or if you have a list of users and a list of the URLs visited, that you want to combine to see which user navigated which URLs.