# Mask data

**URL:** <https://discuss.elastic.co/t/mask-data/124694>\
**Category:** Kibana\
**Created:** [March 20, 2018, 6:41am UTC](https://discuss.elastic.co/t/mask-data/124694 "2018-03-20T06:41:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdulshukkoor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulshukkoor/32/27683_2.png) [@abdulshukkoor](https://discuss.elastic.co/u/abdulshukkoor)\
**Post date:** [March 20, 2018, 6:41am UTC](https://discuss.elastic.co/t/mask-data/124694/1 "2018-03-20T06:41:05Z")

</div>

I need to mask some confidential data in Kibana. Consider that userId needs to be masked in Kibana visualizations.  
I want the userIds to be displayed as user1, user2, user3 etc in the visualizations.  
There need not be any mapping between the real userId and masked userId.

Is this possible in Kibana?

![Screenshot%20(21)](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a84b2375cc062018c381847f1c03dc051348f133.png)

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [March 20, 2018, 8:11am UTC](https://discuss.elastic.co/t/mask-data/124694/2 "2018-03-20T08:11:07Z")

</div>

Hi Abdul,

I currently see multiple possible solutions for that.

a) you could just disable the labels on the x-axis for this chart. That way it will just show the bars without any label.  
b) you could create a custom "anonymizing" field formatter, that will take a string as an input and outputs instead just a short replacement name. You can have a log at [this blogpost](https://www.elastic.co/blog/kibana-custom-field-formatters) for more information.  
c) Use a [scripted field](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) on the index, that uses the value from the users field, and instead will output some random hash for it.

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![abdulshukkoor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulshukkoor/32/27683_2.png) [@abdulshukkoor](https://discuss.elastic.co/u/abdulshukkoor)\
**Post date:** [March 22, 2018, 9:56am UTC](https://discuss.elastic.co/t/mask-data/124694/3 "2018-03-22T09:56:22Z")

</div>

Hi @timroes,

when I went through the blog, I could see you saying, "In the future, we (the Kibana team) will be working on providing this functionality as a plugin, which will help simplify the registration proces" . Is this plugin there in the current version of Kibana?

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [March 22, 2018, 10:55am UTC](https://discuss.elastic.co/t/mask-data/124694/4 "2018-03-22T10:55:46Z")

</div>

Hi,

you can already use this in a plugin. What you basically need to do is just register a `fieldFormats` `uiExport` in your plugin ([https://www.elastic.co/guide/en/kibana/master/development-uiexports.html](https://www.elastic.co/guide/en/kibana/master/development-uiexports.html)).

That file would then be the file you do all the registration in. Also have a look at the Kibana plugin itself, how to use this setting: [https://github.com/elastic/kibana/blob/master/src/core\_plugins/kibana/index.js#L39](https://github.com/elastic/kibana/blob/master/src/core_plugins/kibana/index.js#L39)

Cheers,  
Tim

---

<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:** [April 19, 2018, 11:10am UTC](https://discuss.elastic.co/t/mask-data/124694/5 "2018-04-19T11:10:33Z")

</div>

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