Need assistance with visualizing multiple queries in Kibana

Hi all. I am new to Kibana and still trying to get my head around the documentation. This is what I want to achieve - I have a query for successful requests and another for all the requests, I am looking to visualize a histogram of sorts, that will display the count of successful requests in a vertical bar (in one color) and the count of all requests in an adjacent vertical bar(in another color) - this plotted per day. Below is what I tried on DEV Tools. But I am not sure how to transform this to the Visualize tab? If I were to use the Discover tab, am essentially looking at 2 filters (one for success, and another for all requests), so not sure how to combine them to display in a single graph ? Been breaking my head around this, greatly appreciate any help from experts/seniors here! Thanks in advance!
{
"aggs": {
"group_by_requests": {
"filters": {
"filters": {
"success_requests": {
"bool": {
"must": [
{"match_phrase":{"status":"200 OK"}},
{"match_phrase": {
"field1":"value1"}},
{"match_phrase": {
"field2":"value2"}},
{"match_phrase": {
"field3":"value3"}},
{"wildcard": {
"field4": {
"value": "*value4"
}
}},
{"range" : { "app.@timestamp": {
"gte" : "now-30d",
"lt" : "now"
}
}}
]
}
},
"all_requests": {
"bool": {
"must": [
{"match_phrase": {
"field1":"value1"}},
{"match_phrase": {
"field2":"value2"}},
{"match_phrase": {
"field3":"value3"}},
{"wildcard": {
"field4": {
"value": "*value4"
}
}},
{"range" : { "app.@timestamp": {
"gte" : "now-30d",
"lt" : "now"
}
}}
]
}
}
}
},
"aggs" : {
"requests_per_day" : {
"date_histogram": {
"field": "timestamp",
"interval": "1d"
}
}
}
}
}

}

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