There are some use cases where some app owners might not need all types of logs: RTR, APP, STG etc. It would be nice if inclusion and exclusion filters could be added in order that the downstream consumers are not overloaded with unneeded data. This would also save some costs for outgoing network traffic for the operators.
As there already is a drain-data Syslog Drain URL parameter, the extension with exclude-log-types parameter is easy to implement. Theexclude-log-types parameter should only be taken into account when there is no data filtering by type, no drain-data or drain-type parameter is set or when the value of these parameters is logs. The values for the exclude-log-types should be lower case variants of the log types listed in the link above: app,rtr,stg,cell, etc. Multiple values for the log types should be possible to set: exclude-log-types=rtr,cell,stg
The validation and parsing of the data type is done in the getBindingType and the actual filtering sending or skipping log envelopes in the Write and sendsLogs functions. This should be extended to take the log type exclusion filter into account.
The inspection of log type for the log envelopes can be done with the source_type tag.
To check the logs and the source types, one can use the following command of the log-cache cli plugin:
cf tail -n 10 -c logs --json <app_guid>|jq '.batch[].tags.source_type
"APP/PROC/WEB"
"APP/PROC/WEB"
"APP/PROC/WEB"
"APP/PROC/WEB"
"RTR"
"APP/PROC/WEB"
"APP/PROC/WEB"
"RTR"
The filtering of application logs might be a bit costly as it will involve string parsing. We should take the performance into account and decide if:
- we should put the app logs filtering behind a feature flag, so that the cf operators explicitly are aware about the possible performance degradation and want to to have that
- say that by definition the application logs cannot be filtered out, as the app developers would be most interested in them
Example setup usage:
exclude RTR and CELL logs:
cf cups -l https://my-syslog-server.com?exclude-log-types=rtr,cell
There are some use cases where some app owners might not need all types of logs: RTR, APP, STG etc. It would be nice if inclusion and exclusion filters could be added in order that the downstream consumers are not overloaded with unneeded data. This would also save some costs for outgoing network traffic for the operators.
As there already is a
drain-dataSyslog Drain URL parameter, the extension withexclude-log-typesparameter is easy to implement. Theexclude-log-typesparameter should only be taken into account when there is no data filtering by type, nodrain-dataordrain-typeparameter is set or when the value of these parameters islogs. The values for theexclude-log-typesshould be lower case variants of the log types listed in the link above:app,rtr,stg,cell, etc. Multiple values for the log types should be possible to set:exclude-log-types=rtr,cell,stgThe validation and parsing of the data type is done in the getBindingType and the actual filtering sending or skipping log envelopes in the Write and sendsLogs functions. This should be extended to take the log type exclusion filter into account.
The inspection of log type for the log envelopes can be done with the source_type tag.
To check the logs and the source types, one can use the following command of the log-cache cli plugin:
The filtering of application logs might be a bit costly as it will involve string parsing. We should take the performance into account and decide if:
Example setup usage:
exclude RTR and CELL logs:
cf cups -l https://my-syslog-server.com?exclude-log-types=rtr,cell