I have some tomcat app logs in which i am parsing the TransactionName and TransactionStatus fields. My end goal is to create a single value visualisation which shows the percentage of successful transactions over total.
But the gauge is showing the value of the last interval. Not the average over your whole timespan. So you might want to change the interval from the default auto to something that puts everything in your timespan into one bucket. WARNING: You should turn off the Auto Apply when changing the interval or you'll have errors (there's a bug on it).
Lastly, there's also a Markdown tab that lets you put the value with other text. And when you save this visualization it seems that it saves whatever panel you're on. So you can add it to a dashboard.
Thanks Lee for the nice explanation, but for me it doesnt work. In my case the TransationStatus field is text based and i want to calculate what was the percentage of Successful transaction out of total.
If you just go to Discover, and look at your total Hits count in the upper left corner,
then in the query bar put transactionStatus:success does that filter your docs down to only the "Success" ones you're looking for?
Do all your docs have either success or failure? If so, then the visual builder screen I showed should work because it's doing transactionStatus:success/*
In this case * means all docs, which is both success and failure.
If some of your docs don't have either success or failure, then we'll need to use something other than * for the denominator.
Not all of them have TransactionStatus:Success or TransactionStatus:Failure, some of the documents have that field as blank. But my main intent is to count all the documents with either Success or Failure and calculate the percentage for Success.
OK, so in that case the Denominator should be the total where your transactionStatus is either success or failure. In
Elasticsearch queries, listing 2 search terms implies OR so in this screenshot I've listed 2 search terms in the denominator and one in the numerator field. This is giving me metricseat.name:process/(metricset.name:process + metricset.name:filesystem)
(you don't have to multiply by 100 because there is already a percent formatting option)
i changed the time picker to just reflect documents for last 24 hours, the discovery tab is showing the total number of documents is 88 and documents which have TransactionStatus:Success is 77, so the percentage should be 90.5 but it is showing 100 % , its strange.
Thanks for your patience. I'm learning more about Visual Builder as I go here...
If you have your first aggregation which is a Filter Ratio which is calculating success/(success or failure).
That ratio probably changes over time, and your gauge or markdown is showing the last value. But it sounds like you want a metric that shows the percentage over the entire timespan, which might be Last 15 minutes or Last 30 days.
So you can add Overall Average aggregation to do that. First click the + sign on your existing aggregation, and then select Overall Average under the Sibling Pipeline Aggregations.
The Metric field to the right, should list your Filter Ratio aggregation from above (mine is different in this screenshot);
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.