Tail and OpenTSDB Integration
Powerful performance with an easy integration, powered by Telegraf, the open source data connector built by InfluxData.
5B+
Telegraf downloads
#1
Time series database
Source: DB Engines
1B+
Downloads of InfluxDB
2,800+
Contributors
Table of Contents
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started
Input and output integration overview
The Tail Telegraf plugin collects metrics by tailing specified log files, capturing new log entries in real-time for further analysis.
The OpenTSDB plugin facilitates the integration of Telegraf with OpenTSDB, allowing users to push time-series metrics to an OpenTSDB backend seamlessly.
Integration details
Tail
The tail plugin is designed to continuously monitor and parse log files, making it ideal for real-time log analysis and monitoring. It mimics the functionality of the Unix tail
command, allowing users to specify a file or pattern and begin reading new lines as they are added. Key features include the ability to follow log-rotated files, start reading from the end of a file, and support various parsing formats for the log messages. Users can customize the plugin through various configuration options, such as specifying file encoding, the method for watching file updates, and filter settings for processing log data. This plugin is particularly valuable in environments where log data is critical for monitoring application performance and diagnosing issues.
OpenTSDB
The OpenTSDB plugin is designed to send metrics to an OpenTSDB instance using either the telnet or HTTP mode. With the introduction of OpenTSDB 2.0, the recommended method for sending metrics is via the HTTP API, which allows for batch processing of metrics by configuring the ‘http_batch_size’. The plugin supports several configuration options including metrics prefixing, server host and port specification, URI path customization for reverse proxies, and debug options for diagnosing communication issues with OpenTSDB. This plugin is particularly useful in scenarios where time series data is generated and needs to be efficiently stored in a scalable time series database like OpenTSDB, making it suitable for a wide range of monitoring and analytics applications.
Configuration
Tail
[[inputs.tail]]
## File names or a pattern to tail.
## These accept standard unix glob matching rules, but with the addition of
## ** as a "super asterisk". ie:
## "/var/log/**.log" -> recursively find all .log files in /var/log
## "/var/log/*/*.log" -> find all .log files with a parent dir in /var/log
## "/var/log/apache.log" -> just tail the apache log file
## "/var/log/log[!1-2]* -> tail files without 1-2
## "/var/log/log[^1-2]* -> identical behavior as above
## See https://github.com/gobwas/glob for more examples
##
files = ["/var/mymetrics.out"]
## Read file from beginning.
# from_beginning = false
## Whether file is a named pipe
# pipe = false
## Method used to watch for file updates. Can be either "inotify" or "poll".
## inotify is supported on linux, *bsd, and macOS, while Windows requires
## using poll. Poll checks for changes every 250ms.
# watch_method = "inotify"
## Maximum lines of the file to process that have not yet be written by the
## output. For best throughput set based on the number of metrics on each
## line and the size of the output's metric_batch_size.
# max_undelivered_lines = 1000
## Character encoding to use when interpreting the file contents. Invalid
## characters are replaced using the unicode replacement character. When set
## to the empty string the data is not decoded to text.
## ex: character_encoding = "utf-8"
## character_encoding = "utf-16le"
## character_encoding = "utf-16be"
## character_encoding = ""
# character_encoding = ""
## Data format to consume.
## 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"
## Set the tag that will contain the path of the tailed file. If you don't want this tag, set it to an empty string.
# path_tag = "path"
## Filters to apply to files before generating metrics
## "ansi_color" removes ANSI colors
# filters = []
## multiline parser/codec
## https://www.elastic.co/guide/en/logstash/2.4/plugins-filters-multiline.html
#[inputs.tail.multiline]
## The pattern should be a regexp which matches what you believe to be an indicator that the field is part of an event consisting of multiple lines of log data.
#pattern = "^\s"
## The field's value must be previous or next and indicates the relation to the
## multi-line event.
#match_which_line = "previous"
## The invert_match can be true or false (defaults to false).
## If true, a message not matching the pattern will constitute a match of the multiline filter and the what will be applied. (vice-versa is also true)
#invert_match = false
## The handling method for quoted text (defaults to 'ignore').
## The following methods are available:
## ignore -- do not consider quotation (default)
## single-quotes -- consider text quoted by single quotes (')
## double-quotes -- consider text quoted by double quotes (")
## backticks -- consider text quoted by backticks (`)
## When handling quotes, escaped quotes (e.g. \") are handled correctly.
#quotation = "ignore"
## The preserve_newline option can be true or false (defaults to false).
## If true, the newline character is preserved for multiline elements,
## this is useful to preserve message-structure e.g. for logging outputs.
#preserve_newline = false
#After the specified timeout, this plugin sends the multiline event even if no new pattern is found to start a new event. The default is 5s.
#timeout = 5s
OpenTSDB
[[outputs.opentsdb]]
## prefix for metrics keys
prefix = "my.specific.prefix."
## DNS name of the OpenTSDB server
## Using "opentsdb.example.com" or "tcp://opentsdb.example.com" will use the
## telnet API. "http://opentsdb.example.com" will use the Http API.
host = "opentsdb.example.com"
## Port of the OpenTSDB server
port = 4242
## Number of data points to send to OpenTSDB in Http requests.
## Not used with telnet API.
http_batch_size = 50
## URI Path for Http requests to OpenTSDB.
## Used in cases where OpenTSDB is located behind a reverse proxy.
http_path = "/api/put"
## Debug true - Prints OpenTSDB communication
debug = false
## Separator separates measurement name from field
separator = "_"
Input and output integration examples
Tail
-
Real-Time Server Health Monitoring: Implement the Tail plugin to parse web server access logs in real-time, providing immediate visibility into user activity, error rates, and performance metrics. By visualizing this log data, operations teams can quickly identify and respond to spikes in traffic or errors, enhancing system reliability and user experience.
-
Centralized Log Management: Utilize the Tail plugin to aggregate logs from multiple sources across a distributed system. By configuring each service to send its logs to a centralized location via the Tail plugin, teams can simplify log analysis and ensure that all relevant data is accessible from a single interface, streamlining troubleshooting processes.
-
Security Incident Detection: Use this plugin to monitor authentication logs for unauthorized access attempts or suspicious activity. By setting up alerts on certain log messages, teams can leverage this plugin to enhance security postures and respond promptly to potential security threats, reducing the risk of breaches and increasing overall system integrity.
-
Dynamic Application Performance Insights: Integrate with analytics tools to create real-time dashboards that display application performance metrics based on log data. This setup not only helps developers diagnose bottlenecks and inefficiencies but also allows for proactive performance tuning and resource allocation, optimizing application behavior under varying loads.
OpenTSDB
-
Real-time Infrastructure Monitoring: Utilize the OpenTSDB plugin to collect and store metrics from various infrastructure components. By configuring the plugin to push metrics to OpenTSDB, organizations can have a centralized view of their infrastructure health and performance over time.
-
Custom Application Metrics Tracking: Integrate the OpenTSDB plugin into custom applications to track key performance indicators (KPIs) such as response times, error rates, and user interactions. This setup allows developers and product teams to visualize application performance trends and make data-driven decisions.
-
Automated Anomaly Detection: Leverage the plugin in conjunction with machine learning algorithms to automatically detect anomalies in time-series data sent to OpenTSDB. By continuously monitoring the incoming metrics, the system can train models that alert users to potential issues before they affect application performance.
-
Historical Data Analysis: Use the OpenTSDB plugin to store and analyze historical performance data for capacity planning and trend analysis. This provides valuable insights into system behavior over time, helping teams to understand usage patterns and prepare for future growth.
Feedback
Thank you for being part of our community! If you have any general feedback or found any bugs on these pages, we welcome and encourage your input. Please submit your feedback in the InfluxDB community Slack.
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started
Related Integrations
Related Integrations
HTTP and InfluxDB Integration
The HTTP plugin collects metrics from one or more HTTP(S) endpoints. It supports various authentication methods and configuration options for data formats.
View IntegrationKafka and InfluxDB Integration
This plugin reads messages from Kafka and allows the creation of metrics based on those messages. It supports various configurations including different Kafka settings and message processing options.
View IntegrationKinesis and InfluxDB Integration
The Kinesis plugin allows for reading metrics from AWS Kinesis streams. It supports multiple input data formats and offers checkpointing features with DynamoDB for reliable message processing.
View Integration