Skip to content

Commit

Permalink
chore(processors): migrate sample configs into separate files (#11125)
Browse files Browse the repository at this point in the history
  • Loading branch information
sspaink authored May 18, 2022
1 parent 2488d75 commit d345348
Show file tree
Hide file tree
Showing 26 changed files with 625 additions and 0 deletions.
47 changes: 47 additions & 0 deletions plugins/processors/aws/ec2/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Attach AWS EC2 metadata to metrics
[[processors.aws_ec2]]
## Instance identity document tags to attach to metrics.
## For more information see:
## https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html
##
## Available tags:
## * accountId
## * architecture
## * availabilityZone
## * billingProducts
## * imageId
## * instanceId
## * instanceType
## * kernelId
## * pendingTime
## * privateIp
## * ramdiskId
## * region
## * version
imds_tags = []

## EC2 instance tags retrieved with DescribeTags action.
## In case tag is empty upon retrieval it's omitted when tagging metrics.
## Note that in order for this to work, role attached to EC2 instance or AWS
## credentials available from the environment must have a policy attached, that
## allows ec2:DescribeTags.
##
## For more information see:
## https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTags.html
ec2_tags = []

## Timeout for http requests made by against aws ec2 metadata endpoint.
timeout = "10s"

## ordered controls whether or not the metrics need to stay in the same order
## this plugin received them in. If false, this plugin will change the order
## with requests hitting cached results moving through immediately and not
## waiting on slower lookups. This may cause issues for you if you are
## depending on the order of metrics staying the same. If so, set this to true.
## Keeping the metrics ordered may be slightly slower.
ordered = false

## max_parallel_calls is the maximum number of AWS API calls to be in flight
## at the same time.
## It's probably best to keep this number fairly low.
max_parallel_calls = 10
10 changes: 10 additions & 0 deletions plugins/processors/clone/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Apply metric modifications using override semantics.
[[processors.clone]]
## All modifications on inputs and aggregators can be overridden:
# name_override = "new_name"
# name_prefix = "new_name_prefix"
# name_suffix = "new_name_suffix"

## Tags to be added (all values must be strings)
# [processors.clone.tags]
# additional_tag = "tag_value"
28 changes: 28 additions & 0 deletions plugins/processors/converter/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Convert values to another metric value type
[[processors.converter]]
## Tags to convert
##
## The table key determines the target type, and the array of key-values
## select the keys to convert. The array may contain globs.
## <target-type> = [<tag-key>...]
[processors.converter.tags]
measurement = []
string = []
integer = []
unsigned = []
boolean = []
float = []

## Fields to convert
##
## The table key determines the target type, and the array of key-values
## select the keys to convert. The array may contain globs.
## <target-type> = [<field-key>...]
[processors.converter.fields]
measurement = []
tag = []
string = []
integer = []
unsigned = []
boolean = []
float = []
24 changes: 24 additions & 0 deletions plugins/processors/date/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dates measurements, tags, and fields that pass through this filter.
[[processors.date]]
## New tag to create
tag_key = "month"

## New field to create (cannot set both field_key and tag_key)
# field_key = "month"

## Date format string, must be a representation of the Go "reference time"
## which is "Mon Jan 2 15:04:05 -0700 MST 2006".
date_format = "Jan"

## If destination is a field, date format can also be one of
## "unix", "unix_ms", "unix_us", or "unix_ns", which will insert an integer field.
# date_format = "unix"

## Offset duration added to the date string when writing the new tag.
# date_offset = "0s"

## Timezone to use when creating the tag or field using a reference time
## string. This can be set to one of "UTC", "Local", or to a location name
## in the IANA Time Zone database.
## example: timezone = "America/Los_Angeles"
# timezone = "UTC"
4 changes: 4 additions & 0 deletions plugins/processors/dedup/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Filter metrics with repeating field values
[[processors.dedup]]
## Maximum time to suppress output
dedup_interval = "600s"
15 changes: 15 additions & 0 deletions plugins/processors/defaults/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Set default fields on your metric(s) when they are nil or empty
[[processors.defaults]]
## Ensures a set of fields always exists on your metric(s) with their
## respective default value.
## For any given field pair (key = default), if it's not set, a field
## is set on the metric with the specified default.
##
## A field is considered not set if it is nil on the incoming metric;
## or it is not nil but its value is an empty string or is a string
## of one or more spaces.
## <target-field> = <value>
[processors.defaults.fields]
field_1 = "bar"
time_idle = 0
is_error = true
23 changes: 23 additions & 0 deletions plugins/processors/enum/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Map enum values according to given table.
[[processors.enum]]
[[processors.enum.mapping]]
## Name of the field to map. Globs accepted.
field = "status"

## Name of the tag to map. Globs accepted.
# tag = "status"

## Destination tag or field to be used for the mapped value. By default the
## source tag or field is used, overwriting the original value.
dest = "status_code"

## Default value to be used for all values not contained in the mapping
## table. When unset and no match is found, the original field will remain
## unmodified and the destination tag or field will not be created.
# default = 0

## Table of mappings
[processors.enum.mapping.value_mappings]
green = 1
amber = 2
red = 3
15 changes: 15 additions & 0 deletions plugins/processors/execd/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Run executable as long-running processor plugin
[[processors.execd]]
## One program to run as daemon.
## NOTE: process and each argument should each be their own string
## eg: command = ["/path/to/your_program", "arg1", "arg2"]
command = ["cat"]

## Environment variables
## Array of "key=value" pairs to pass as environment variables
## e.g. "KEY=value", "USERNAME=John Doe",
## "LD_LIBRARY_PATH=/opt/custom/lib64:/usr/local/libs"
# environment = []

## Delay before the process is restarted after an unexpected termination
# restart_delay = "10s"
30 changes: 30 additions & 0 deletions plugins/processors/filepath/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Performs file path manipulations on tags and fields
[[processors.filepath]]
## Treat the tag value as a path and convert it to its last element, storing the result in a new tag
# [[processors.filepath.basename]]
# tag = "path"
# dest = "basepath"

## Treat the field value as a path and keep all but the last element of path, typically the path's directory
# [[processors.filepath.dirname]]
# field = "path"

## Treat the tag value as a path, converting it to its the last element without its suffix
# [[processors.filepath.stem]]
# tag = "path"

## Treat the tag value as a path, converting it to the shortest path name equivalent
## to path by purely lexical processing
# [[processors.filepath.clean]]
# tag = "path"

## Treat the tag value as a path, converting it to a relative path that is lexically
## equivalent to the source path when joined to 'base_path'
# [[processors.filepath.rel]]
# tag = "path"
# base_path = "/var/log"

## Treat the tag value as a path, replacing each separator character in path with a '/' character. Has only
## effect on Windows
# [[processors.filepath.toslash]]
# tag = "path"
58 changes: 58 additions & 0 deletions plugins/processors/ifname/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Add a tag of the network interface name looked up over SNMP by interface number
[[processors.ifname]]
## Name of tag holding the interface number
# tag = "ifIndex"

## Name of output tag where service name will be added
# dest = "ifName"

## Name of tag of the SNMP agent to request the interface name from
# agent = "agent"

## Timeout for each request.
# timeout = "5s"

## SNMP version; can be 1, 2, or 3.
# version = 2

## SNMP community string.
# community = "public"

## Number of retries to attempt.
# retries = 3

## The GETBULK max-repetitions parameter.
# max_repetitions = 10

## SNMPv3 authentication and encryption options.
##
## Security Name.
# sec_name = "myuser"
## Authentication protocol; one of "MD5", "SHA", or "".
# auth_protocol = "MD5"
## Authentication password.
# auth_password = "pass"
## Security Level; one of "noAuthNoPriv", "authNoPriv", or "authPriv".
# sec_level = "authNoPriv"
## Context Name.
# context_name = ""
## Privacy protocol used for encrypted messages; one of "DES", "AES" or "".
# priv_protocol = ""
## Privacy password used for encrypted messages.
# priv_password = ""

## max_parallel_lookups is the maximum number of SNMP requests to
## make at the same time.
# max_parallel_lookups = 100

## ordered controls whether or not the metrics need to stay in the
## same order this plugin received them in. If false, this plugin
## may change the order when data is cached. If you need metrics to
## stay in order set this to true. keeping the metrics ordered may
## be slightly slower
# ordered = false

## cache_ttl is the amount of time interface names are cached for a
## given agent. After this period elapses if names are needed they
## will be retrieved again.
# cache_ttl = "8h"
21 changes: 21 additions & 0 deletions plugins/processors/noise/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Adds noise to numerical fields
[[processors.noise]]
## Specified the type of the random distribution.
## Can be "laplacian", "gaussian" or "uniform".
# type = "laplacian

## Center of the distribution.
## Only used for Laplacian and Gaussian distributions.
# mu = 0.0

## Scale parameter for the Laplacian or Gaussian distribution
# scale = 1.0

## Upper and lower bound of the Uniform distribution
# min = -1.0
# max = 1.0

## Apply the noise only to numeric fields matching the filter criteria below.
## Excludes takes precedence over includes.
# include_fields = []
# exclude_fields = []
10 changes: 10 additions & 0 deletions plugins/processors/override/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Apply metric modifications using override semantics.
[[processors.override]]
## All modifications on inputs and aggregators can be overridden:
# name_override = "new_name"
# name_prefix = "new_name_prefix"
# name_suffix = "new_name_suffix"

## Tags to be added (all values must be strings)
# [processors.override.tags]
# additional_tag = "tag_value"
17 changes: 17 additions & 0 deletions plugins/processors/parser/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Parse a value in a specified field/tag(s) and add the result in a new metric
[[processors.parser]]
## The name of the fields whose value will be parsed.
parse_fields = ["message"]

## If true, incoming metrics are not emitted.
drop_original = false

## If set to override, emitted metrics will be merged by overriding the
## original metric using the newly parsed metrics.
merge = "override"

## The dataformat to be read from files
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "influx"
6 changes: 6 additions & 0 deletions plugins/processors/pivot/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Rotate a single valued metric into a multi field metric
[[processors.pivot]]
## Tag to use for naming the new field.
tag_key = "name"
## Field to use as the value of the new field.
value_key = "value"
18 changes: 18 additions & 0 deletions plugins/processors/port_name/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Given a tag/field of a TCP or UDP port number, add a tag/field of the service name looked up in the system services file
[[processors.port_name]]
## Name of tag holding the port number
# tag = "port"
## Or name of the field holding the port number
# field = "port"

## Name of output tag or field (depending on the source) where service name will be added
# dest = "service"

## Default tcp or udp
# default_protocol = "tcp"

## Tag containing the protocol (tcp or udp, case-insensitive)
# protocol_tag = "proto"

## Field containing the protocol (tcp or udp, case-insensitive)
# protocol_field = "proto"
2 changes: 2 additions & 0 deletions plugins/processors/printer/sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Print all metrics that pass through this filter.
[[processors.printer]]
Loading

0 comments on commit d345348

Please sign in to comment.