This message was deleted.
# support
s
This message was deleted.
n
You will need to convert
env
and
level
to selected fields first, from the UI. This will reduce the load on the database.
👀 1
j
(chart preview)
Is that simply by adding them to this list?
👍 1
n
Then you will be able to use the columns directly
Copy code
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;
Eg:- here I have used the
bytes
which is a selected field.
❤️ 1
j
oh wow - so it's literally just as simple as something like this?
Copy code
select 
toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 30 MINUTE) AS interval
, toFloat64(count()) as value
, level 
FROM signoz_logs.distributed_logs  
WHERE timestamp BETWEEN {{.start_timestamp_nano}} AND {{.end_timestamp_nano}} and level = 'error'
GROUP BY interval, level;
I'm also a little confused about the difference between
signoz_logs.logs
and
signoz_logs.distributed_logs
. From reading other messages on here it seems like
distributed_logs
operates across a clickhouse cluster? I'm running the entire Signoz stack on a single machine via docker-compose. Presumably, for my set up at least, there should be no difference in the results returned between
signoz_logs.logs
and
signoz_logs.distributed_logs
?
n
Yeah, please go ahead with
distributed_logs
, it is just a wrapper on top of
logs
for distributed support.
1
j
I can confirm that this query runs exactly as expected:
Copy code
select 
toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 30 MINUTE) AS interval
, toFloat64(count()) as value  
FROM signoz_logs.distributed_logs 
WHERE timestamp BETWEEN {{.start_timestamp_nano}} AND {{.end_timestamp_nano}} 
and level = 'error' 
and env = 'dev'
and service = 'graphql'
GROUP BY interval;
Thanks so much @nitya-signoz!
🎉 2