How do I calculate the failure percentage in data table in kibana ?
I have 3 columns like total ,success , failure nd I need to calculate the failure percentage which is ( failure / total ) ×100 . Is there any possible way to calculate it in data table
You would do this using scripted fields for versions below 7.14 or runtime fields for 7.14 and later.
As I'm new with kibana can you please help me with the scripted fields
Index Management -> Index Patterns -> Open your index pattern -> Scripted Fields Tab -> Add Scripted Field
Name your field
Set type as number
For the script you would use something like the below.
double result = (doc['failure'].value / doc['total'].value) * 100;
return result;
I'm using kibana 7.10.2 version
The KQL query for failure is 'NOT statusCode:200'

