SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near "AS"
LINE 10: ...TWEEN $1 AND $2 AND split_part(a.log_key, '#', 2) AS log_key...
                                                              ^ (Connection: pgsql, SQL: SELECT COUNT(0) AS total FROM (SELECT  
                b.name AS client_name,
                --split_part(a.log_key, '#', 1) AS client_id,
                split_part(a.log_key, '#', 2) AS key,
                a.status_code AS code,
                a.message AS msg,
                to_char(a.created_at, 'YYYY-MM-DD HH24:MI:SS') as created
                FROM system_logs a
                JOIN m_clients b on b.id=split_part(a.log_key, '#', 1)::bigint
                WHERE DATE(a.created_at) BETWEEN :start_date AND :end_date AND split_part(a.log_key, '#', 2) AS log_key::TEXT = :filter_0) AS count_query)