README.md in fluent-plugin-cloudwatch-2.0.1 vs README.md in fluent-plugin-cloudwatch-2.1.0

- old
+ new

@@ -237,9 +237,39 @@ ## config: emit_zero If `emit_zero` is true and cloudwatch datapoint is empty, fluent-plugin-cloudwatch emits 0 instead of warn log "datapoint is empty". +## config: record_attr + +`record_attr` is an optional value injected into each records. + +``` +<source> + @type cloudwatch + tag cloudwatch.rds + aws_key_id YOUR_AWS_KEY_ID + aws_sec_key YOUR_AWS_SECRET_KEY + cw_endpoint monitoring.ap-northeast-1.amazonaws.com + + namespace AWS/RDS + metric_name CPUUtilization,FreeStorageSpace + dimensions_name DBInstanceIdentifier + dimensions_value rds01 + record_attr DBInstanceIdentifier:rds01 + # JSON format + # record_attr {"DBInstanceIdentifier":"rds01"} +</source> +``` + +Example output. + +``` +2017-11-04T13:40:00+09:00 cloudwatch.rds {"CPUUtilization":2.0,"DBInstanceIdentifier":"rds01"} +2013-11-04T13:40:00+09:00 cloudwatch.rds {"FreeStorageSpace":104080723968.0,"DBInstanceIdentifier":"rds01"} +``` + + ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`)