Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
  • Loading branch information
LucioFranco committed Dec 16, 2019
1 parent 0ec418f commit d4b11a5
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 31 deletions.
104 changes: 74 additions & 30 deletions website/docs/reference/transforms/aws_ec2_metadata.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
event_types: ["metric"]
issues_url: https://github.com/timberio/vector/issues?q=is%3Aopen+is%3Aissue+label%3A%22transform%3A+add_tags%22
sidebar_label: "add_tags|[\"metric\"]"
source_url: https://github.com/timberio/vector/tree/master/src/transforms/add_tags.rs
event_types: ["log"]
issues_url: https://github.com/timberio/vector/issues?q=is%3Aopen+is%3Aissue+label%3A%22transform%3A+aws_ec2_metadata%22
sidebar_label: "aws_ec2_metadata|[\"log\"]"
source_url: https://github.com/timberio/vector/tree/master/src/transforms/aws_ec2_metadata.rs
status: "prod-ready"
title: "add_tags transform"
title: "aws_ec2_metadata transform"
---

<!--
Expand All @@ -15,7 +15,7 @@ title: "add_tags transform"
website/docs/reference/transforms/aws_ec2_metadata.md.erb
-->

The `add_tags` transform accepts [`metric`][docs.data-model#metric] events and allows you to add one or more metric tags.
The `aws_ec2_metadata` transform accepts [`log`][docs.data-model#log] events and allows you to enrich logs with AWS EC2 instance metadata.

## Configuration

Expand All @@ -25,13 +25,15 @@ import CodeHeader from '@site/src/components/CodeHeader';

```toml
[transforms.my_transform_id]
# REQUIRED - General
type = "add_tags" # example, must be: "add_tags"
# REQUIRED
type = "aws_ec2_metadata" # example, must be: "aws_ec2_metadata"
inputs = ["my-source-id"] # example

# REQUIRED - Tags
[transforms.my_transform_id.tags]
my_tag = "my value"
# OPTIONAL
fields = ["instance-id", "local-hostname", "local-ipv4", "public-hostname", "public-ipv4", "ami-id", "availability-zone", "vpc-id", "subnet-id", "region"] # default
host = "http://169.254.169.254" # default
namespace = "" # default
refresh_interval_secs = 10 # default
```

## Options
Expand All @@ -45,50 +47,92 @@ import Field from '@site/src/components/Field';

<Field
common={true}
defaultValue={null}
defaultValue={["instance-id","local-hostname","local-ipv4","public-hostname","public-ipv4","ami-id","availability-zone","vpc-id","subnet-id","region"]}
enumValues={null}
examples={[]}
name={"tags"}
nullable={false}
examples={[["instance-id","local-hostname","local-ipv4","public-hostname","public-ipv4","ami-id","availability-zone","vpc-id","subnet-id","region"]]}
name={"fields"}
nullable={true}
path={null}
relevantWhen={null}
required={true}
required={false}
templateable={false}
type={"table"}
type={"[string]"}
unit={null}
>
### tags
### fields

A table of key/value pairs representing the tags to be added to the metric.
A list of fields to include in each event.

<Fields filters={false}>

</Field>


<Field
common={true}
defaultValue={null}
defaultValue={"http://169.254.169.254"}
enumValues={null}
examples={[{"my_tag":"my value"},{"my_env_tag":"${ENV_VAR}"}]}
name={"`[tag-name]`"}
nullable={false}
path={"tags"}
examples={["http://169.254.169.254"]}
name={"host"}
nullable={true}
path={null}
relevantWhen={null}
required={true}
required={false}
templateable={false}
type={"string"}
unit={null}
>
#### `[tag-name]`
### host

The name of the tag to add. Due to the nature of metric tags, the value must be a string.
Override the default EC2 Metadata host.


</Field>


</Fields>
<Field
common={true}
defaultValue={""}
enumValues={null}
examples={[""]}
name={"namespace"}
nullable={true}
path={null}
relevantWhen={null}
required={false}
templateable={false}
type={"string"}
unit={null}
>
### namespace

Prepend a namespace to each field's key.


</Field>


<Field
common={true}
defaultValue={10}
enumValues={null}
examples={[10]}
name={"refresh_interval_secs"}
nullable={true}
path={null}
relevantWhen={null}
required={false}
templateable={false}
type={"int"}
unit={null}
>
### refresh_interval_secs

The interval in seconds at which the EC2 Metadata api will be called.


</Field>

Expand All @@ -108,4 +152,4 @@ section.


[docs.configuration#environment-variables]: /docs/setup/configuration#environment-variables
[docs.data-model#metric]: /docs/about/data-model#metric
[docs.data-model#log]: /docs/about/data-model#log
2 changes: 1 addition & 1 deletion website/docs/reference/transforms/aws_ec2_metadata.md.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- component = metadata.transforms.add_tags -%>
<%- component = metadata.transforms.aws_ec2_metadata -%>
<%= component_header(component) %>

Expand Down

0 comments on commit d4b11a5

Please sign in to comment.