Collect from CSV file's column as an intelsdi-x snap metric.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Snap collector plugin - csvreader

This plugin collects log messages partially for each collection run. Log file reading is limited by time.

Build Status

It's used in the Snap framework.

  1. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  3. License
  4. Acknowledgements

Getting Started

System Requirements

Operating systems

All OSs currently supported by snap:

  • Linux/amd64
  • Darwin/amd64


To build the plugin binary:


Clone repo into $GOPATH/src/

$ git clone<yourGithubID>/snap-plugin-collector-csvreader.git

Build the plugin by running make within the cloned repo:

$ make

This builds the plugin in ./build/

Configuration and Usage

Task manifest configuration options

Option Description Default value
"source" Declaration of full path file name, in CSV format "opt/snap/files/metrics.csv"
"attrs" Defines the list of column indexes that want to collect, separated by comma "0,1"
"units" The units corresponding to the indexes of each metric "date,amps"


Collected Metrics

This plugin has the ability to gather the following metrics:

Namespace Description
/intel/csvreader/[index]/[source]/message Single column metric


This is an example running csvreader collector and writing data to a file. It is assumed that you are using the latest Snap binary and plugins.

The example is run from a directory which includes snaptel, snapteld, along with the plugins and task file.

In one terminal window, open the Snap daemon (in this case with logging set to 1 and trust disabled):

$ snapteld -l 1 -t 0

In another terminal window:

Download csvreader collector plugin:

$ wget -O snap-plugin-collector-csvreader

Load csvreader plugin

$ snaptel plugin load snap-plugin-collector-csvreader
Plugin loaded
Name: csvreader
Version: 1
Type: collector
Signed: false
Loaded Time: Thu, 05 Jan 2017 11:58:11 CET

See available metrics for your system

$ snaptel metric list

Create a task manifest file (e.g. task-csvreader.json):

    "version": 1,
    "schedule": {
        "type": "simple",
        "interval": "3s"
    "workflow": {
        "collect": {
            "metrics": {
                "/intel/csvreader/*": {}
            "config": {
                "/intel/csvreader": {
                    "source": "/opt/snap/files/test.csv",
                    "attrs": "0,1",
                    "unit": "u1,u2"
            "publish": [
                    "plugin_name": "file",
                    "config": {
                        "file": "/tmp/published_csvreader"

Download file publisher plugin:

$ wget

Load file plugin for publishing:

$ snaptel plugin load snap-plugin-publisher-file
Plugin loaded
Name: file
Version: 3
Type: publisher
Signed: false
Loaded Time: Fri, 20 Nov 2015 11:41:39 PST

Create task:

$ snaptel task create -t task-csvreader.json
Using task manifest to create task
Task created
ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850
Name: Task-02dd7ff4-8106-47e9-8b86-70067cd0a850
State: Running

See file output (this is just single collection output with default collection_time of 300ms):

Stop task:

$ snaptel task stop 02dd7ff4-8106-47e9-8b86-70067cd0a850
Task stopped:
ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850


There isn't a current roadmap for this plugin, but it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release. If you have a feature request, please add it as an issue and/or submit a pull request.

Community Support

This repository is one of many plugins in Snap, a powerful telemetry framework. See the full project at To reach out to other users, head to the main framework


We love contributions!

There's more than one way to give back, from examples to csvreader to code updates. See our recommended process in


Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.


And thank you! Your contribution, through code and participation, is incredibly important to us.