(Real World: Value Masking)
ID: 915
See: {@Literal}, Introduction
using uCalcSoftware;
var uc = new uCalc();
// Creating a "Clean View" of a log or configuration file by replacing all
// actual data values with a placeholder, leaving only the structural identifiers.
var t = new uCalc.Transformer();
// Replace every literal with a generic placeholder
t.FromTo("{@Literal}", "?");
string input = """
setting_a = 500; setting_b = "active";
""";
Console.WriteLine(t.Transform(input));
setting_a = ?; setting_b = ?; using uCalcSoftware; var uc = new uCalc(); // Creating a "Clean View" of a log or configuration file by replacing all // actual data values with a placeholder, leaving only the structural identifiers. var t = new uCalc.Transformer(); // Replace every literal with a generic placeholder t.FromTo("{@Literal}", "?"); string input = """ setting_a = 500; setting_b = "active"; """; Console.WriteLine(t.Transform(input));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
// Creating a "Clean View" of a log or configuration file by replacing all
// actual data values with a placeholder, leaving only the structural identifiers.
uCalc::Transformer t;
// Replace every literal with a generic placeholder
t.FromTo("{@Literal}", "?");
string input = R"(setting_a = 500; setting_b = "active";)";
cout << t.Transform(input) << endl;
}
setting_a = ?; setting_b = ?; #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // Creating a "Clean View" of a log or configuration file by replacing all // actual data values with a placeholder, leaving only the structural identifiers. uCalc::Transformer t; // Replace every literal with a generic placeholder t.FromTo("{@Literal}", "?"); string input = R"(setting_a = 500; setting_b = "active";)"; cout << t.Transform(input) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
'// Creating a "Clean View" of a log or configuration file by replacing all
'// actual data values with a placeholder, leaving only the structural identifiers.
Dim t As New uCalc.Transformer()
'// Replace every literal with a generic placeholder
t.FromTo("{@Literal}", "?")
Dim input As String = "setting_a = 500; setting_b = ""active"";"
Console.WriteLine(t.Transform(input))
End Sub
End Module
setting_a = ?; setting_b = ?; Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() '// Creating a "Clean View" of a log or configuration file by replacing all '// actual data values with a placeholder, leaving only the structural identifiers. Dim t As New uCalc.Transformer() '// Replace every literal with a generic placeholder t.FromTo("{@Literal}", "?") Dim input As String = "setting_a = 500; setting_b = ""active"";" Console.WriteLine(t.Transform(input)) End Sub End Module