2.x
Ask or search…
K

Copy Keys

Copies the value of a source key to the destinations value
The Copy Keys action copies the value of a source key to the destinations value. When applied to your processing rule, the Copy Keys action copies the value of the source key of each record, and then replaces it with the destination key of the same record.
For example, given the following sample website log data:
{"timestamp":"2023-03-28T09:08:41.64283645Z","user_id":3,"page_id":30,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:42.643343109Z","user_id":4,"page_id":10,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:48.643600498Z","user_id":1,"page_id":50,"action":"click"}
{"timestamp":"2023-03-28T09:08:50.643773688Z","user_id":5,"page_id":40,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:51.643932272Z","user_id":1,"page_id":30,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:56.644080944Z","user_id":2,"page_id":40,"action":"click"}
{"timestamp":"2023-03-28T09:09:03.64425954Z","user_id":3,"page_id":30,"action":"click"}
{"timestamp":"2023-03-28T09:09:03.644317046Z","user_id":1,"page_id":20,"action":"view"}
{"timestamp":"2023-03-28T09:09:10.64447719Z","user_id":2,"page_id":50,"action":"purchase"}
{"timestamp":"2023-03-28T09:09:17.644810963Z","user_id":2,"page_id":10,"action":"view"}
{"timestamp":"2023-03-28T09:09:20.644994805Z","user_id":1,"page_id":50,"action":"view"}
To copy the values from the user_id key to the page_id key for each record:
  1. 1.
    In the processing rules tab, in the Actions dropdown, select Copy keys.
  2. 2.
    In the Source key field, enter user_id.
  3. 3.
    In the Destination key field, enter page_id.
  4. 4.
    Optional: Select the Regex mode checkbox if you want to treat src as a regular expression and dst as a substitution pattern.
  5. 5.
    Click Apply.
Copy Keys Processing Rule Action
Your processing rule will now replace the value for page_id for every record with the value of the user_id of the same record. At completion, the values of user_id and page_id will be the same for each record.