Splunk Search

How to write the regex with mode=sed in a search to mask part of credit card numbers?

gagi76
New Member

I need help with one particular search for masking credit card numbers, but with this output 22222#######2222. I know how to manage search for ############2222, but don't know how to mask between numbers.

Thanks, cheers

0 Karma
1 Solution

lukasz92
Communicator

Please write your search (for masking like ############2222) - we could modify it

View solution in original post

0 Karma

lukasz92
Communicator

Please write your search (for masking like ############2222) - we could modify it

0 Karma

gagi76
New Member
mod=sed "s/(\\d{12})/############/g"
0 Karma

lukasz92
Communicator

Something like mod=sed "s/(\\d{5})(\\d{7})(\\d{4})/\\1############\\3/g"

Will rewrite first match, write hashes and third match

edited; I forgot about escaping \

gagi76
New Member

It's great, thanks!

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...