I'm trying to come up with a query that's a percentage of users (via session ids) experiencing errors. i can find the number of unique sessions with index="my-index" | stats dc(session_id)
and the number of unique users seeing errors with index="my-index" category="error" | stats dc(session_id)
, but I can't seem to bring these two numbers together and make a ratio. Any recommendations?
Hello @cochang,
Try using the appendcols command:
index="my-index" | stats dc(session_id) as total_sessions
| appendcols [search index="my-index" category="error" | stats dc(session_id) as error_sessions]
| eval percentage=round(error_sessions/total_sessions*100,2)."%"
Hello @cochang,
Try using the appendcols command:
index="my-index" | stats dc(session_id) as total_sessions
| appendcols [search index="my-index" category="error" | stats dc(session_id) as error_sessions]
| eval percentage=round(error_sessions/total_sessions*100,2)."%"