Hello, maybe you could help me, I have a query that counts the total events by category “event.category”, when using the summarize command I cannot calculate the total events in this way to obtain the percentage it represents in an additional column, EX: %=100*(count per Category/Total)
Using lookupcommand you can add (calculated by another query) total count to each of of rows. Then you you can divide particular count by total number of events. Lookup command requires joining fields to be specified. I used event.kind on both sided as it will have only one value for this query and no “fake key” needs to be produced.
After a basic query additional summarization needs to happen. This way we can calculate total (sum of individual counts). In order not to lose details, we need to collect components in arrays of pairs (event.category and a). After summarization we can bring back original row count using expandcommand after which each row will have total field ready to calculate percentage.
We are trying to do a similar thing, only using Log data. From a query cost perspective, would the summarize and expand option be “cheaper”, as we don’t have to run a subquery?