# Detect CreditCard numbers in Logs

**URL:** <https://discuss.elastic.co/t/detect-creditcard-numbers-in-logs/255381>\
**Category:** Logs\
**Tags:** elastic-stack-alerting\
**Created:** [November 13, 2020, 9:38pm UTC](https://discuss.elastic.co/t/detect-creditcard-numbers-in-logs/255381 "2020-11-13T21:38:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishakh](https://avatars.discourse-cdn.com/v4/letter/v/c89c15/32.png) [@vishakh](https://discuss.elastic.co/u/vishakh)\
**Post date:** [November 13, 2020, 9:38pm UTC](https://discuss.elastic.co/t/detect-creditcard-numbers-in-logs/255381/1 "2020-11-13T21:38:42Z")

</div>

Currently, we're running ELK-Stack and I would like to setup-configure detection & alerts for logs containing CreditCard numbers.

I did skim through certain ELK-modules, but couldn't find any suitable that can achieve the objective objective. Can anyone please suggest me on this

---

<div class="post-metadata">

**Author:** ![Iker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iker/32/91708_2.png) [@Iker](https://discuss.elastic.co/u/Iker)\
**Post date:** [November 13, 2020, 10:12pm UTC](https://discuss.elastic.co/t/detect-creditcard-numbers-in-logs/255381/2 "2020-11-13T22:12:28Z")

</div>

You could use queries or watchers with a regex for credit cards, this should work:

```
/([0-9]{13,16}|[0-9]{4}.[0-9]{4}.[0-9]{4}.[0-9]{4})/

```

> **[Regexp query | Elasticsearch Reference \[7.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html)**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 11, 2020, 10:12pm UTC](https://discuss.elastic.co/t/detect-creditcard-numbers-in-logs/255381/3 "2020-12-11T22:12:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
