Skip to main content
Sumo Logic

Configure Telegraf Output Plugin for Sumo Logic

Learn how to configure the Telegraf output plugin for Sumo Logic to send metrics to Sumo Logic.

This page has instructions for configuring the Telegraf output plugin for Sumo Logic.

Configure Hosted Collector and HTTP Source

In order to send data to Sumo Logic with Telegraf’s Sumo Logic output plugin you need to create a Hosted Collector with an HTTP Source to ingest the data. For instructions see:

Configure Sumo Logic output plugin

Once your collector and source are configured, you can specify the output plugin’s configuration. 

The minimum configuration is to specify url, the URL for the HTTP source, and data_format, your metrics’ format.

[[outputs.sumologic]]
  url = "https://events.sumologic.net/receiver/v1/http/<HTTPSourceCode>"
  data_format = "carbon2"
  # or
  # data_format = "graphite"
  # or
  # data_format = "prometheus"

For all plugin configuration options, see Sumo Logic output plugin configuration options, below.

About metric formats

This section has examples of the metric formats that Sumo Logic supports.

  • Carbon2
    metric=redis field=used_memory_rss host=host port=6379 replication_role=master server=localhost  7696384 1600101200  
  • Graphite
    host.6379.master.localhost.redis.used_memory_rss 7700480 1600101195
  • Prometheus
    redis_used_memory_rss{host="host",port="6379",replication_role="master",server="localhost"} 7.692288e+0
  • Carbon2
    You can tweak the carbon2 format using the metrics_format option. For example:
    • carbon2_format = "field_separate"
      metric=redis field=used_memory_rss host=host port=6379 replication_role=master server=localhost  7696384 1600101200
    • carbon2_format = "metric_includes_field"
      metric=redis_used_memory_rss host=host port=6379 replication_role=master server=localhost  7684096 1600101338

Filtering metrics

You can use Telegraf measurement filtering to limit the set of metrics sent to output. The following settings might be particularly useful:

  • namepass. An array of glob pattern strings. Only points whose measurement name matches a pattern in this list are emitted.
  • fieldpass. An array of glob pattern strings. Only fields whose field key matches a pattern in this list are emitted.

Below, we’ve expanded the minimal configuration of of the Sumo Logic output plugin to collect  only available and free memory metrics from the memory input plugin:

url = "https://events.sumologic.net/receiver/v1/http/<HTTPSourceCode>"
data_format = "carbon2"

namepass = ["mem"]
fieldpass = ["used", "free"]

Sumo Logic output plugin configuration options

This section describes the configuration options for the Telegraf output plugin for Sumo Logic, a plugin that sends metrics from a Telegraf agent in a non-Kubernetes deployment to Sumo Logic. 

url

Specifies the URL to which the plugin will send metrics. This will be the URL for an HTTP Source running on a Sumo Logic Hosted Collector. 

Example

url = "https://events.sumologic.net/receiver/v1/http/<UniqueHTTPCollectorCode>"

data_format

The format of the metrics to be sent. The value you specify will be used to set the Content-Type header. For more information about content type headers for metrics, see the Content type headers for metrics section of the Upload Metrics to an HTTP Source topic.

Supported values for data_format are: 

Value Content-Type
“graphite” application/vnd.sumologic.graphite
“carbon2” application/vnd.sumologic.carbon2
“prometheus” application/vnd.sumologic.prometheus


Example

data_format = "carbon2"

timeout

The timeout for the HTTP request.

Example

timeout = "5s"

method

Specifies the HTTP method for the HTTP request.

Supported values:

  • "POST" 

Example

method = "POST"

max_request_body_size 

The maximum  HTTP request body size in bytes before compression.

The recommended value is 1 MB, which you would specify as 1000000.

Example

max_request_body_size = 1000000

source_name

If you specify a value, it will override the source name associated with the HTTP source to which the metrics will be sent, specified by the url option. 

Example

source_name="My Preferred Source Name"

source_host

If you specify a value, it will override the source host associated with the HTTP source to which the metrics will be sent, specified by url option. 

Example

source_host="My Preferred Source Host"

source_category

If you specify a value, it will override the source category defined for the HTTP source  to which the metrics will be sent, specified by url option. 
 
Example

source_category="prod/uno/dos"

dimensions

A comma-separated list of dimensions, in key=value format, to apply to the metrics sent to Sumo Logic. Applying custom dimensions to metrics allows you to query them at a more granular level in Sumo Logic. 

Example

dimensions="env=prod,div=plack"