The mask user PII dataflow reads JSON records and uses Regex to mask Social Security Numbers (SSNs). The following diagram is a visual representation of these operations generated by sdf:
If you prefer to run this dataflow using packages, run the package-variant instead.
Take a look at the dataflow.yaml to see how we've implemented it.
Use sdf command line tool to run the dataflow:
sdf run --uiUse --ui to generate the graphical representation and run the Studio.
The sample data file used to run this test ./sample-data/data.txt has the following records:
{"name": "Alice", "ssn": "555-12-1212"}
{"name": "Bob", "ssn": "123-45-6789"}Produce the data to in user-info topic:
fluvio produce user-info -f ./sample-data/data.txtCheckout the data in user-info topic:
fluvio consume user-info -BdConsume from masked to retrieve the result:
fluvio consume masked -Bd{"name": "Alice", "ssn": "***-**-****"}
{"name": "Bob", "ssn": "***-**-****"}Exit sdf terminal and clean-up. The --force flag removes the topics:
sdf clean --force