# How to hide some data(Sensitive data)

**URL:** <https://discuss.elastic.co/t/how-to-hide-some-data-sensitive-data/160191>\
**Category:** Elasticsearch\
**Created:** [December 10, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-to-hide-some-data-sensitive-data/160191 "2018-12-10T14:30:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![murtazahzaveri](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@murtazahzaveri](https://discuss.elastic.co/u/murtazahzaveri)\
**Post date:** [December 10, 2018, 2:30pm UTC](https://discuss.elastic.co/t/how-to-hide-some-data-sensitive-data/160191/1 "2018-12-10T14:30:02Z")

</div>

Following is my query:  
{  
size: 0,  
aggs:{  
property:{  
nested: {path: "dept"},  
aggs: {  
dept\_name: {  
terms: {  
field: "dept.dept\_name"  
size: 10000  
},  
aggs: {  
id: {  
cardinality: {  
field:"dept\_dept\_name.id"  
}  
}  
}  
}  
}  
}  
}

**I will get the output as::**

"buckets":[  
{  
"key":"IT",  
"doc\_count":1212,  
"id":{  
"value":4}  
}  
]

**But i want the out put as**  
"buckets":[  
{  
"key":"XXXXX",(Key\_name shouldnt be displayed)  
"doc\_count":1212,  
"id":{  
"value":4}  
}  
]

I dont want to display the Key\_just doc count and value because my key data is sensitive data.  
Is there any way to hide the following data.

Thanks,

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [December 14, 2018, 9:35am UTC](https://discuss.elastic.co/t/how-to-hide-some-data-sensitive-data/160191/2 "2018-12-14T09:35:07Z")

</div>

I don't think there is a way to do this easily and performant at this point.

---

<div class="post-metadata">

**Author:** ![murtazahzaveri](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@murtazahzaveri](https://discuss.elastic.co/u/murtazahzaveri)\
**Post date:** [December 18, 2018, 8:05am UTC](https://discuss.elastic.co/t/how-to-hide-some-data-sensitive-data/160191/3 "2018-12-18T08:05:52Z")

</div>

Hi..I found the work around by filter\_path to display the data which is required .. 😛

---

<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:** [January 15, 2019, 8:05am UTC](https://discuss.elastic.co/t/how-to-hide-some-data-sensitive-data/160191/4 "2019-01-15T08:05:57Z")

</div>

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