Can I create dashboard based on logs? Like number ...
# general
ł
Can I create dashboard based on logs? Like number of specific logs per second.
a
yes..you can..using clickhouse queries in the dashboards @nitya-signoz can you share a sample query on logs for reference?
ł
@nitya-signoz Hi, could you show some sample query to visualise logs data? I'm not familiar with this query language, I need something to start from.
n
@Łukasz Herman here are three examples
Copy code
Count of logs over time
select toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS interval, toFloat64(count()) as value from signoz_logs.logs  where timestamp > toUnixTimestamp64Nano(now64() - INTERVAL 30 MINUTE)  group by interval order by interval asc;

Count of error logs over time
select toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS interval, toFloat64(count()) as value from signoz_logs.logs  where timestamp > toUnixTimestamp64Nano(now64() - INTERVAL 30 MINUTE) AND stream='stderr' group by interval order by interval asc;

Quantile
select toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS interval, quantile(0.9)(bytes) as value from signoz_logs.logs  where timestamp > toUnixTimestamp64Nano(now64() - INTERVAL 30 MINUTE)  group by interval order by interval asc;
Please note that things in the where clause are interesting fields. For more aggregate functions refer to https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/