tail_csv plugin¶
| Plugin name | tail_csv |
| Type | read |
| Callbacks | config, init, read, shutdown |
| Status | supported |
| Since | 5.3 |
| Copyright | 2013 Kris Nielander, 2013 Florian Forster |
| License | GPLv2 |
| Configuration | collectd.conf(5) |
Description¶
The Tail CSV plugin "follows" (tails) and parses CSV files.
This plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior. Please read the Plugin tail_csv section of the collectd.conf(5) manual page for an in-depth description of the plugin's configuration.
Synopsis¶
<Plugin "tail_csv">
<Metric "snort-dropped">
Type "percent"
Instance "dropped"
Index 1
</Metric>
<File "/var/log/snort/snort.stats">
Instance "snort-eth0"
Interval 600
Collect "snort-dropped"
</File>
</Plugin>
Example graphs¶
None yet. Add one now!
Dependencies¶
- none
See also¶
Configuration¶
Configuration options · from collectd.conf(5)
See this section in the full configuration reference
The tail_csv plugin reads files in the CSV format, e.g. the statistics file written by Snort.
Synopsis:
<Plugin "tail_csv">
<Metric "snort-dropped">
Type "percent"
Instance "dropped"
ValueFrom 1
</Metric>
<File "/var/log/snort/snort.stats">
Plugin "snortstats"
Instance "eth0"
Interval 600
Collect "snort-dropped"
FieldSeparator ","
#TimeFrom 0
</File>
</Plugin>
The configuration consists of one or more Metric blocks that define an index into the line of the CSV file and how this value is mapped to collectd's internal representation. These are followed by one or more Instance blocks which configure which file to read, in which interval and which metrics to extract.
- <Metric Name>
-
The Metric block configures a new metric to be extracted from the statistics file and how it is mapped on collectd's data model. The string Name is only used inside the Instance blocks to refer to this block, so you can use one Metric block for multiple CSV files.
- Type Type
- Configures which Type to use when dispatching this metric. Types are defined in the types.db(5) file, see the appropriate manual page for more information on specifying types. Only types with a single data source are supported by the tail_csv plugin. The information whether the value is an absolute value (i.e. a
GAUGE) or a rate (i.e. aDERIVE) is taken from the Type's definition. - Instance TypeInstance
- If set, TypeInstance is used to populate the type instance field of the created value lists. Otherwise, no type instance is used.
- ValueFrom Index
- Configure to read the value from the field with the zero-based index Index. If the value is parsed as signed integer, unsigned integer or double depends on the Type setting, see above.
- <File Path>
-
Each File block represents one CSV file to read. There must be at least one File block but there can be multiple if you have multiple CSV files.
- Plugin Plugin
- Use Plugin as the plugin name when submitting values. Defaults to
tail_csv. - Instance PluginInstance
- Sets the plugin instance used when dispatching the values.
- Collect Metric
- Specifies which Metric to collect. This option must be specified at least once, and you can use this option multiple times to specify more than one metric to be extracted from this statistic file.
- Interval Seconds
- Configures the interval in which to read values from this instance / file. Defaults to the plugin's default interval.
- TimeFrom Index
- Rather than using the local time when dispatching a value, read the timestamp from the field with the zero-based index Index. The value is interpreted as seconds since epoch. The value is parsed as a double and may be factional.
- FieldSeparator Character
- Specify the character to use as field separator while parsing the CSV. Defaults to ',' if not specified. The value can only be a single character.