From ccf0ac94e6c375fbfc0c1c9b437d4420c4b933cd Mon Sep 17 00:00:00 2001 From: user Date: Sun, 24 Mar 2024 15:15:06 +0100 Subject: chart limit to last 2 days --- src/db_handler.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/db_handler.py') diff --git a/src/db_handler.py b/src/db_handler.py index 7ba74f8..7c40d51 100644 --- a/src/db_handler.py +++ b/src/db_handler.py @@ -63,6 +63,7 @@ def get_histogram_detailed() -> str: SELECT count(la.id) as total_count, date_trunc('hour', la.timestamp) as date, cn.ip FROM login_attempt la JOIN connection cn on cn.id = la.connection +WHERE la.timestamp BETWEEN current_timestamp - interval '2 days' AND la.timestamp GROUP BY date_trunc('hour', la.timestamp), cn.ip ORDER BY COUNT(la.id) ; -- cgit v1.2.3