A company wants to use Cloud Logging and logs-based metrics on Google Cloud Platform to monitor and analyze their application's logs for specific events. They need to create a logs-based metric to count the occurrences of a specific error pattern in their logs. Which of the following approaches would be the most effective in achieving this goal?