Identifying by ip + user_agent.

This commit is contained in:
sergiotarxz 2022-11-17 02:03:37 +01:00
parent 0b968afa1a
commit 5576215fd4
1 changed files with 4 additions and 4 deletions

View File

@ -45,20 +45,20 @@ EOF
my $data = $dbh->selectrow_hashref(<<'EOF', undef); my $data = $dbh->selectrow_hashref(<<'EOF', undef);
SELECT SELECT
( (
SELECT COUNT(DISTINCT remote_address) FROM requests SELECT COUNT(DISTINCT (remote_address, user_agent)) FROM requests
) as unique_ips, ) as unique_ips,
( (
SELECT COUNT(DISTINCT remote_address) SELECT COUNT(DISTINCT (remote_address, user_agent))
FROM requests FROM requests
where date > NOW() - interval '1 day' where date > NOW() - interval '1 day'
) as unique_ips_last_24_hours, ) as unique_ips_last_24_hours,
( (
SELECT COUNT(DISTINCT remote_address) SELECT COUNT(DISTINCT (remote_address, user_agent))
FROM requests FROM requests
where date > NOW() - interval '1 week' where date > NOW() - interval '1 week'
) as unique_ips_last_week, ) as unique_ips_last_week,
( (
SELECT COUNT(DISTINCT remote_address) SELECT COUNT(DISTINCT (remote_address, user_agent))
FROM requests FROM requests
where date > NOW() - interval '1 month' where date > NOW() - interval '1 month'
) as unique_ips_last_month; ) as unique_ips_last_month;