# Graylog Labs Article - Redacting Message Fields for Privacy Purposes

**URL:** <https://community.graylog.org/t/graylog-labs-article-redacting-message-fields-for-privacy-purposes/27000>\
**Category:** Graylog Labs\
**Created:** [December 20, 2022, 3:45pm UTC](https://community.graylog.org/t/graylog-labs-article-redacting-message-fields-for-privacy-purposes/27000 "2022-12-20T15:45:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim\_dawson](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jim\_dawson](https://community.graylog.org/u/jim_dawson)\
**Post date:** [December 20, 2022, 3:45pm UTC](https://community.graylog.org/t/graylog-labs-article-redacting-message-fields-for-privacy-purposes/27000/1 "2022-12-20T15:45:31Z")

</div>

Hey everyone!

I’m Jim Dawson, a Solutions Engineer here at Graylog. I work with a lot of customers who have privacy concerns regarding their logs, for instance, users in Germany who fall under BDSG want anonymisation or pseudo-anonymisation of their logs to protect their employees. I wrote the article linked below to address a common question that comes up around this topic, it’s also a good primer on using Processing Pipelines.

If you have any questions or any requests for content on similar topics, please let me know. Hope you all enjoy!

> **[Redacting Message Fields for Privacy Purposes](https://www.graylog.org/post/redacting-message-fields-for-privacy-purposes/)**
>
> Many organizations today have strict data privacy regulations that they must comply with. These privacy regulations can often clash with the requirements of security, application and operations teams who need detailed log information. At Graylog,...

---

<div class="post-metadata">

**Author:** ![H077E](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/h077e/32/15231_2.png) [@H077E](https://community.graylog.org/u/H077E)\
**Post date:** [March 28, 2023, 8:35am UTC](https://community.graylog.org/t/graylog-labs-article-redacting-message-fields-for-privacy-purposes/27000/2 "2023-03-28T08:35:58Z")

</div>

Thanks for your article.  
I am “affected” by the privacy law in germany 😉

The OpenVPN login names in my company must be pseudonymised.  
I chose an simple way. A fixed number (a salt) is appended to each OpenVPN user name field.

```auto
rule "Pseudonymization of OpenVPN User Name"
when
  has_field("OVPN_LoginUser")  
then
  let login_user = to_string($message.OVPN_LoginUser);
  let hash = sha1(login_user + "<SALT>");
  set_field("OVPN_LoginUser", hash + "_hash");
  set_field("message", "*OVPN_Privacy*");
 ..... for more privacy, remove additional fields if necessary .....
end

```
