I am giving a small snippet of my code. I am pushing elements into the hash in this way.
$main_hash{"query"}{"filtered"}{"query"}{"bool"}{"must"} = \@file_arra
+y;
$main_hash{"query"}{"filtered"}{"filter"} = $condition_array[(int($con
+dition)-1)];
I need the query in the first place. But getting the filter in the first place. How to bind the query in first place????
Expected output (After changing into JSON):
{
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{"wildcard": {
"path": "/home/GEMS/CDRS/Delivery/ravi_16051820*.log"
}
}
]
}
},
"filter": {
"bool": {
"should": [
{
"term": {
"OrigInterface": "SMPP"
}
},
{
"term": {
"OrigInterface": "SMPP"
}
}
]
}
}
}
}
}
Actual output
{
"query": {
"filtered": {
"filter": {
"bool": {
"should": [
{
"term": {
"OrigInterface": "SMPP"
}
},
{
"term": {
"OrigInterface": "SMPP"
}
}
]
}
},
"query": {
"bool": {
"must": [
{"wildcard": {
"path": "/home/GEMS/CDRS/Delivery/ravi_16051820*.log"
}
}
]
}
}
}
}
}