... | eval ratio=cacheHit/(cacheHit+cacheMiss) | ...
if cacheHit and cacheMiss arent fields... and specifically arent integers, then you'll have to create your own with some eval magic like this example which creates counters based on finding patterns in the raw event data:
... | eval cacheHits=if(match(_raw,"Pattern that is found in cache hit events"),cacheHits+1,cacheHits) | eval cacheMisses=if(match(_raw,"Pattern that is found in cache miss events"),cacheMisses+1,cacheMisses) | eval cacheHitRatio=cacheHits/(cacheHits+cacheMisses) | table cacheHits, cacheMisses, cacheHitRatio
If this worked as an answer, please use the "mark as answer" link below the answer. The upvote is certainly appreciated as well. Glad to help!