Skip to main content
Solved

Cribl Search Masking Redaction Handling Inquiry

  • January 31, 2026
  • 16 replies
  • 1 view

This message originated from Cribl Community Slack.
Click here to view the original link.

How do you handle masking/redacting in Cribl Search?

Best answer by Jon Rust

You could use Data -> Datatypes rules to mask data as it's parsed. You'll want to use the "Add Fields to Events" space and the C.Mask() method

16 replies

Jon Rust
Forum|alt.badge.img
  • Employee
  • January 31, 2026
Use the extend function plus any number of string functions

Jon Rust
Forum|alt.badge.img
  • Employee
  • January 31, 2026
... | extend field=replace_regex(field,@'\b\d{14,16}\b','xxx')

  • Author
  • New Participant
  • January 31, 2026
I was looking for more like hide sensitive info from users. so when they search, it's already redacted.

Jon Rust
Forum|alt.badge.img
  • Employee
  • Answer
  • January 31, 2026
You could use Data -> Datatypes rules to mask data as it's parsed. You'll want to use the "Add Fields to Events" space and the C.Mask() method

  • Author
  • New Participant
  • January 31, 2026
I will try that. Thank you!

  • New Participant
  • January 31, 2026
can do further up in Stream as well, including encryption https://docs.cribl.io/search/release-notes/release-v4150/#cryptographic-functions

  • Author
  • New Participant
  • January 31, 2026
@user can you give me an example of what do I add here? say if I want to mask credit card number. how do I use C.Mask function?

Links for this message:
image.png

Jeremiah Ross
@user I'd recommend using the Mask function. Here is a list of C.Mask options

Links for this message:
image.png

Jeremiah Ross
You can start with something simple like: C.Mask.REDACTED

Jeremiah Ross
Here is an example with IPs

Links for this message:
image.png

Jon Rust
Forum|alt.badge.img
  • Employee
  • January 31, 2026
@user i can't tell what your requirements are, but you might be able to use a simple replace

Links for this message:
image.png

Jon Rust
Forum|alt.badge.img
  • Employee
  • January 31, 2026
as @user showed, the Mask functions give some extra capabilities not possible with plain ol Replace* tho

Jeremiah Ross
you may use grouping when identifying patterns and specifying which portion to mask. For example:

Links for this message:
image.png

Jeremiah Ross
``Regex: (cardNumber=)([-0-9]+) Replace Express: ${g1}${C.Mask.REDACTED}````

Jeremiah Ross
The expression for md5 might look more like:
${g1}${C.Mask.md5(g2,g2.length)}

  • Author
  • New Participant
  • January 31, 2026
_raw.replace worked! thank you!