How to hide some data(Sensitive data)

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,

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

Hi..I found the work around by filter_path to display the data which is required .. :stuck_out_tongue:

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