What are transformers?

Transformers are different ways to navigate structured data to ‘transform’ a piece of it by either redacting or replacing the value with a surrogate value.

Transformer Examples

Most Common:

  • JSONPath (JSON)
  • XPath (XML)
  • Form


{"customer": [ {"name": "John Doe",
  "address_city": "Springfield",
  "address_country": "USA",
  "address_line1": "123 Main St.",
  "address_line2": null,
  "address_state": "CA",
  "address_zip": "99999",
  "credit_card": "4111111111111111",
  "card_exp": "9/23",
  "card_cvv": "123"}]

To redact the PCI data in this we would simply need to create two JSONPath transformers.

Nesting with JSONPath is fairly straight forward every level down you go in standard JSON is just $.toplevelkey.midlevelkey.finallevelkey if there are lists in between you select the item using the index (or can use a wildcard (*) for anything in the list). If you want to experiment with JSONPath check out this tool.

To redact the credit_card number. All we have to to do is select the key. With JSONPath selected as transformer enter on the line next to it this snippet:


In advanced options you can select FPE to keep the credit card format for mod 10/ Luhn validation.

To redact the CVV we need to store that in memory, not persistently. So, we add a “Rule Chain Entry”.

Do exactly the same thing but change JSONPath to:


In advanced options we need to select Token Management Volatile


<?xml version="1.0" encoding="utf-8"?>
<soapenv:**_Envelope_** xmlns:soapenv="" xmlns:xsd="http:rg/2chema" xmlns:xsi="">
        <**_AddCardResponse_** xmlns="">
            <ResponseDesc>New Card Purchase Order Completed Successfully (932501******1238)</ResponseDesc>
            <NameOnCard>Andrew </NameOnCard>

XPath navigates the nodes so we start by going to Envelope, then Body, then AddCardResponse, then New Card Number and then Number (what we want to redact):


To check XPath navigation this tool.


The last type of transformer in this guide is the Form transformer. This one is pretty straightforward. Basically, we just use the form field input names as the selector.

HTML form example:

<div class="creditCardForm">
    <div class="heading">
        <h1>Confirm Purchase</h1>
    <div class="payment">
        <form action="https://<tenantid>" method="post">
            <div class="form-group owner">
                <label for="owner">Owner</label>
                <input type="text" class="form-control" name="owner" id="owner">
            <div class="form-group CVV">
                <label for="cvv">CVV</label>
                <input type="text" class="form-control" name="cvv" id="cvv">
            <div class="form-group" id="card-number-field">
                <label for="cardNumber">Card Number</label>
                <input type="text" class="form-control" name="cardNumber" id="cardNumber">
            <div class="form-group" name="expiration-date" id="expiration-date">
                <label>Expiration Date</label>
                    <option value="01">January</option>
                    <option value="02">February </option>
                    <option value="03">March</option>
                    <option value="04">April</option>
                    <option value="05">May</option>
                    <option value="06">June</option>
                    <option value="07">July</option>
                    <option value="08">August</option>
                    <option value="09">September</option>
                    <option value="10">October</option>
                    <option value="11">November</option>
                    <option value="12">December</option>
                    <option value="16"> 2016</option>
                    <option value="17"> 2017</option>
                    <option value="18"> 2018</option>
                    <option value="19"> 2019</option>
                    <option value="20"> 2020</option>
                    <option value="21"> 2021</option>
            <div class="form-group" id="pay-now">
                <button type="submit" class="btn btn-default" id="confirm-purchase">Confirm</button>

For forms the “name” of the input field is all that’s required to replace with a surrogate value.

Select the “Form” transformer and just enter:


and under a volatile rule for cvv


These three examples cover the most common transformer use cases. If you have any questions or trouble please contact