Obfuscation
This page describes how to use obfuscation functions in Lenses SQL Processors.
ANONYMIZE
This page describes the ANONYMIZE function in Lenses SQL.
Obfuscates the entire string input.
Available in:
Sample code:
USE `kafka`;
SELECT
ANONYMIZE(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "*******",
"first_name": "Charles"
}
}
MASK
This page describes the MASK function in Lenses SQL.
Alias for ANONYMIZE.
Available in:
Sample code:
USE `kafka`;
SELECT
MASK(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "*******",
"first_name": "Charles"
}
}
EMAIL
This page describes the EMAIL function in Lenses SQL.
Anonymize the value and obfuscate an email address.
Available in:
Sample code:
USE `kafka`;
SELECT
EMAIL(email) AS email_hidden,
email
FROM users-events
LIMIT 1;
Output:
{
"value": {
"email_hidden": "B*****@hotmail.com",
"email": "Brenda.Pierce@hotmail.com"
}
FIRST1
This page describe the FIRST1 function in Lenses SQL.
Anonymize the value and only keep the first character.
Available in:
Sample code:
USE `kafka`;
SELECT
FIRST1(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "M*****",
"first_name": "Melissa"
}
}
FIRST2
This page describes the FIRST2 function in Lenses SQL.
Anonymize the value and only keep the first two characters.
Available in:
Sample code:
USE `kafka`;
SELECT
FIRST2(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "Ch*****",
"first_name": "Charles"
}
}
FIRST3
This page describes the FIRST3 function in Lenses SQL.
Anonymize the value and only keep the first three characters.
Available in:
Sample code:
USE `kafka`;
SELECT
FIRST3(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "Bre*****",
"first_name": "Brenda"
}
}
FIRST4
This page describes the FIRST4 function in Lenses SQL.
Anonymize the value and only keep the first four characters.
Available in:
Sample code:
USE `kafka`;
SELECT
FIRST4(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "Char*****",
"first_name": "Charles"
}
}
LAST1
This page describes the LAST1 function in Lenses SQL.
Anonymize the value and only keep the last character.
Available in:
Sample code:
USE `kafka`;
SELECT
LAST1(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "*****s",
"first_name": "Charles"
}
}
LAST2
This page describes the LAST2 function in Lenses SQL.
Anonymize the value and only keep the last two characters.
Available in:
Sample code:
USE `kafka`;
SELECT
LAST2(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "*****es",
"first_name": "Charles"
}
}
LAST3
This page describes the LAST3 function in Lenses SQL.
Anonymize the value and only keep the last three characters.
Available in:
Sample code:
USE `kafka`;
SELECT
LAST3(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "*****nda",
"first_name": "Brenda"
}
}
LAST4
This page describes the LAST4 function in Lenses SQL.
Anonymize the value and only keep the last four characters.
Available in:
Sample code:
USE `kafka`;
SELECT
LAST4(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "*****enda",
"first_name": "Brenda"
}
}
INITIALS
This page describes the INITALS function in Lenses SQL.
Anonymize the value and only keep the initials of all the words in the input.
Available in:
Sample code:
USE `kafka`;
SELECT
INITIALS(first_name) AS first_name_hidden,
first_name
FROM users-events
LIMIT 1;
Output:
{
"value": {
"first_name_hidden": "C",
"first_name": "Charles"
}
}