To address the issue discussed above, Hadoop provides a filter
class, which provides regular expressions to filter the metrics and make it more compact and meaningful as follows:
*.source.filter.class=org.apache.hadoop.metrics2.filter.GlobFilter *.record.filter.class=${*.source.filter.class} *.metric.filter.class=${*.source.filter.class}
The syntax of the filter
class is explained as follows:
subsystem.[sink|source].sink_name.[sources|record|metric].filter.[include|exclude] subsystem – daemon: hbase, yarn, hdfs, etc sink|source – sink or source for feed sink_name – name of sink used sources|record|metric – level of filter to operate include|exclude – will filter exclude or include metrics.
The filters can be applied at the level of source, record, or metrics and constructed with regex for trimming the information generated by the metrics system.