Hi,
I have an ES nested object in the below format
"campaigns": [
{
"campaignId": 110,
"clickedCount": 1,
"openedCount": 2
},
{
"campaignId": 1322,
"clickedCount": 1,
"openedCount": 0
}
]
Now I want to iterate each nested object and create a new inline scripted field in the nested object based on the openedCount field in the object. if openedCount > 1 then newopenedCount = 1 else newopenedCount = 0 and the updated nested field should be in below format.
"campaigns": [
{
"campaignId": 110,
"clickedCount": 1,
"openedCount": 2,
"newopenedCount" : 1
},
{
"campaignId": 1322,
"clickedCount": 1,
"openedCount": 0,
"newopenedCount" : 0
}
]
I tried with painless scripted field, but I'm unable to do it. Please help me with this.