I am trying to understand the differences between the inclusion and exclusion filters in Google Cloud Logging, but there is very little documentation on how inclusion filters affects the Log Router/Sink. To illustrate, these are snippets that describe the information I can find on inclusion filters.
From Overview of Export Logs:
Inclusion filter: Selects which log entries to route through this sink. For inclusion filter examples, see Sample queries.
Exclusion filter: Selects which log entries to explicitly exclude from routing, even if the log entries match the sink's inclusion filter.
An excerpt from Exporting Logs from the Cloud Console
- Choose logs to include in the sink: Build an inclusion filter: Enter a filter to select the logs you want routed to the sink's destination.
- Choose logs to exclude from the sink (optional): Build an exclusion filter: Select Add exclusion and enter a filter to select logs you don't want routed to the sink's destination.
Thus, my questions are as listed below:
- It appears to me that these filters are overlapping in terms of functionality, so what exactly is the difference? (E.g. Are logs not ingested due to an inclusion filter identical to logs excluded via an exclusion filter? Are log entries not included by an inclusion filter also discarded in the same way as log entries excluded by an exclusion filter?)
- Why is there also the ability to determine exclusion filtering rates for exclusion filters? What purpose does it serve?
Edit: To further illustrate my point, there appears to be information indicating that some tangible differences between inclusion and exclusion filters used to exist, as seen on this article in Medium:
Each log entry that is received by Cloud Logging is compared against the exclusion filters and the inclusion filters. These comparisons are independent.
To determine if a log entry is exported to a destination, the log entry is compared to the log sink query of an inclusion filter. When a match occurs, the log entry is exported to the sink destination. A log entry might match multiple inclusion filters.
To determine if a log entry is discarded or saved in Cloud Logging storage, the log entry is compared to the exclusion filters. If it matches any exclusion filter, the log entry is discarded. Otherwise, the log entry is saved in Cloud Logging storage.
However, but there doesn't appear to be any similar information or even distinction between the filters on the latest version of the official documentation