How do you make manual/one-off log-based queries?
In GCP it'll be a two step process:

You should be able to create Log Filters:


https://cloud.google.com/logging/docs/view/advanced-filters


And then use those log filters to create metrics:


https://cloud.google.com/logging/docs/logs-based-metrics/counter-metrics


This won't be as flexible or seamless as a SQL query, but the filters should provide you with a way to select the logs you're interested in, and the metrics should allow you to count them.

If you are keen on using SQL, you will need to export your log data to Big Query.  You can do this manually when you need to, or you can set up sinks to automatically send new logs that match criteria to Big Query.  Once the data is exported, you would be using the Big Query service to run SQL on the logs.

Here is a link on exporting log data to Big Query:


https://cloud.google.com/logging/docs/export/