README.md in fluent-plugin-ec2-metadata-0.0.9 vs README.md in fluent-plugin-ec2-metadata-0.0.10

- old
+ new

@@ -1,11 +1,13 @@ # fluent-plugin-ec2-metadata [![Gem Version](https://badge.fury.io/rb/fluent-plugin-ec2-metadata.svg)](http://badge.fury.io/rb/fluent-plugin-ec2-metadata) [![Build Status](https://travis-ci.org/takus/fluent-plugin-ec2-metadata.svg?branch=master)](https://travis-ci.org/takus/fluent-plugin-ec2-metadata) +[![Dependency Status](https://gemnasium.com/takus/fluent-plugin-ec2-metadata.svg)](https://gemnasium.com/takus/fluent-plugin-ec2-metadata) [![Test Coverage](https://codeclimate.com/github/takus/fluent-plugin-ec2-metadata/badges/coverage.svg)](https://codeclimate.com/github/takus/fluent-plugin-ec2-metadata/coverage) [![Code Climate](https://codeclimate.com/github/takus/fluent-plugin-ec2-metadata/badges/gpa.svg)](https://codeclimate.com/github/takus/fluent-plugin-ec2-metadata) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/16f6786edb554f1ea7462353808011d6)](https://www.codacy.com/app/takus/fluent-plugin-ec2-metadata) [Fluentd](http://fluentd.org) plugin to add ec2 metadata fields to a event record ## Installation Use RubyGems: @@ -27,32 +29,55 @@ hostname ${tagset_name} instance_id ${instance_id} instance_type ${instance_type} az ${availability_zone} vpc_id ${vpc_id} + ami_id ${image_id} + account_id ${account_id} </record> </match> Assume following input is coming: -```js +``` foo.bar {"message":"hello ec2!"} ``` then output becomes as below (indented): -```js +``` i-28b5ee77.foo.bar { "hostname" : "web0001", "instance_id" : "i-28b5ee77", "instance_type" : "m1.large", "az" : "us-west-1b", "vpc_id" : "vpc-25dab194", + "account_id" : "123456789", + "image_id" : "ami-123456", "message" : "hello ec2!" } ``` +Or you can use filter version: + + <filter foo.**> + type ec2_metadata + + aws_key_id YOUR_AWS_KEY_ID + aws_sec_key YOUR_AWS_SECRET/KEY + + <record> + hostname ${tagset_name} + instance_id ${instance_id} + instance_type ${instance_type} + az ${availability_zone} + vpc_id ${vpc_id} + ami_id ${image_id} + account_id ${account_id} + </record> + </filter> + ### Placeholders The following placeholders are always available: * ${tag} input tag @@ -62,9 +87,11 @@ * ${availability_zone} availability zone * ${region} region * ${mac} MAC address * ${vpc_id} vpc id * ${subnet_id} subnet id +* ${account_id} account id +* ${image_id} ami image id The followings are available when you define `aws_key_id` and `aws_sec_key`(or define IAM Policy): * ${tagset_xxx} EC2 tag (e.g. tagset_name is replaced by the value of Key = Name)