Timechart by level

Hi
I need to show logs by level on time chart on dashboard.

here is my the query
{job="varlogs"} | pattern <timestamp> <time> <hostname> <level> <msg>

i try this but doesn’t return result:
{job="varlogs"} | pattern <timestamp> <time> <hostname> <level> <msg> | by (level)

Any idea?
Thanks

Try:

sum(
   count_over_time(
     {job="varlogs"} | pattern <timestamp> <time> <hostname> <level> <msg> [$__interval]
  )
) by (level)
1 Like