I have documents indexed in ElasticSearch like
doc1
{
"_index":"logs_2017-07-22",
"_type":"audit",
"_id":"K",
"_score":null,
"_source":{
"logName":"",
"payload":{
"methodName":"policy",
"response":{
"sdata":{
"pDelta":{
"bDeltas":[
{
"action":"Remove",
"member":"user:abc",
"role":"viewer"
},
{
"action":"Remove",
"member":"user:xyz",
"role":"admin"
},
{
"action":"Add",
"member":"user:pqr",
"role":"deployer"
},
{
"action":"Remove",
"member":"user:jkl",
"role":"admin"
}
]
}
}
}
}
}
}
doc2
{
"_index":"logs_2017-07-22",
"_type":"audit",
"_id":"K",
"_score":null,
"_source":{
"logName":"",
"payload":{
"methodName":"policy",
"response":{
"sdata":{
"pDelta":{
"bDeltas":[
{
"action":"Remove",
"member":"user:abc",
"role":"viewer"
},
{
"action":"Add",
"member":"user:xyz",
"role":"admin"
},
{
"action":"Add",
"member":"user:pqr",
"role":"deployer"
},
{
"action":"Remove",
"member":"user:jkl",
"role":"admin"
}
]
}
}
}
}
}
}
How can I get documents which only has
{
"action": "Remove",
"member": "user:xyz",
"role": "admin"
}
I tried this query in Kibana, but I get both the documents. I am expecting only first document
payload.sdata.pDelta.bDeltas.action:Remove AND payload.sdata.pDelta.bDeltas.member:"user:xyz"