Application | Success | Failed | Total | percentage |
IPL | 15 | 2 | 17 | 11.764 |
IPL | 10 | 2 | 12 | 16.666 |
IPL | 4 | 1 | 5 | 20.000 |
WWV | 3 | 2 | 5 | 40.000 |
WWV | 1 | 0 | 1 | 0.000 |
PIP | 20 | 5 | 25 | 20.000 |
IPL | 1 | 0 | 1 | 0.0000 |
WWV | 30 | 15 | 45 | 33.333 |
PIP | 20 | 10 | 30 | 33.333 |
From the above table, we want to calculate application wise data.
Expected output:
Application | Success | Failed | Total | percentage |
IPL | 30 | 5 | 35 | 14.285 |
WWV | 34 | 17 | 51 | 33.333 |
PIP | 40 | 15 | 55 | 27.272 |
How can we do this???
That is what the stats command does. Use the by keyword to group results based on the values of certain fields.
| stats sum(Success) as Success, sum(Failed) as Failed by Application
| eval Total=Success + Failed
| eval percentage=round(Failed*100/Total, 3)
Thankyou @richgalloway it was pretty simple.
If your problem is resolved, then please click the "Accept as Solution" button to help future readers.