Can I add an condition for metrics aggregation on y axis to check for the specific field value. I'm trying to create a bar chart with 2 y axis aggregation. In one aggregation I want count of all the docs and for another aggregation I only want count of logs with specific field value.
Here For "Total Submission" aggregation I'm taking count of all the logs but for "SonarQube failed checks" aggregation I only want the count of the logs for which the field "name" has the "release_sonarqube_check" value. For that I'm using
{ "script" : "doc['name'].value=release_sonarqube_check"} script but it's not even adding in msearch request body. Can someone suggest if it's possible and what might be the correct way to write script for that?