Seems, you're using PostgreSQL...
The base idea is to get total no. of logs and count of specific errors:
SELECT COUNT(*) AS TotalCount
Count of specific error
SELECT COUNT(*) AS ErrCount
WHERE status = '404 NOT FOUND';
Now, you have to "join" both results into single value:
SELECT ErrCount/Total AS Err404
(<here_comes_second_query>) as ErrCount,
(<here_comes_first_query>) as Total
) as partial_data;
See: sql - How to reuse a result column in an expression for another result column
SELECT COUNT(*) / COUNT(CASE WHEN status='404...' THEN 1 END) AS MyResult
Thanks Kornfeld Eliyahu Peter
] for your valuable suggestion!