Configuration Parameter Types
Types of Configuration Parameters
Common Options
default: Specifies the default value for a parameter. If omitted, theparameter is required. On startup, Fluentd uses the default value instead if
the parameter is not configured.
NOTE: It doesn't perform type conversion such as
timetype, and the specified default value is used as is.
# Required parameter: The configuration must have this parameter like 'param1 10'.
config_param :param1, :integer
# Optional parameter: If the configuration doesn't have 'param2', 100 is used.
config_param :param2, :integer, default: 100secret: Iftrue, the parameter will be masked when Fluentd dumps itsconfiguration on the standard output on startup.
config_param :secret_param, :string, secret: truedeprecated: Specifies the deprecation warning message. If users use thisparameter in the configuration, they will see the deprecation warning on
startup.
obsoleted: Specifies the obsolete error message. If users use this parameterin the configuration, Fluentd raises
Fluent::ConfigErrorand stops.
alias: Alias for this parameter as a symbol.skip_accessor: Iftrue, skip adding accessor to the plugin. For internaluse only!
Data Types
:string
:stringDefines a string parameter.
Code Example:
Configuration Example:
:regexp
:regexpDefines a regexp parameter. Since v1.2.0.
Code Example:
Configuration Example:
:integer
:integerDefines an integer parameter.
Code Example:
Configuration Example:
:float
:floatDefines a float parameter.
Code Example:
Configuration Example:
:size
:sizeDefines a size parameter in bytes.
Available suffixes: { k, m, g, t } (ignore case)
Code Example:
Configuration Example:
Configuration Example:
:time
:timeDefines the length of the time parameter.
Available suffixes: { s, m, h, d } (lower case only).
If omitted, to_f is applied to the value which converts it to seconds.
Code Example:
Configuration Example:
Configuration Example:
:bool
:boolDefines a Boolean parameter.
Code Example:
Configuration Example:
:enum
:enumDefines an enumerated parameter.
Users can choose a value from the list. If a non-listed value is chosen, an error occurs on startup.
Available options
list: List of available values.
Code Example:
Configuration Example:
:array
:arrayDefines an array parameter.
Users can set an array value for a parameter.
Available options
value_type: Defines the type of the value.Available types: {
:string,:integer,:float,:size,:bool,:time}
Code Example:
Configuration Example:
This configuration will be converted to:
:hash
:hashDefines a hash parameter.
Available options
symbolize_keys: Iftrue, the keys are symbolized.value_type: Defines the same type for all values.
Code Example:
Configuration Example:
This configurations will be converted to:
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is an open-source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.
Last updated
Was this helpful?