Plot
Generate data file for GNU Plot
The Plot output plugin generates data files in a format compatible with GNU Plot (gnuplot), a command-line graphing tool. This plugin lets you export your telemetry data for visualization and analysis using gnuplot.
Configuration parameters
This plugin supports the following parameters:
File
Set filename to store the records. If not set, the filename will be the tag associated with the records. If the file can't be opened, the plugin falls back to writing to STDOUT.
none
Key
Specify the key name from the record to extract as the value. The value must be a numeric type (integer or float). If not specified, the plugin uses the first field from the record.
none
Output format
The Plot output plugin generates data files in a format suitable for gnuplot. The output format is space-separated values with two columns: timestamp and value.
The output format is:
timestamp valueWhere:
timestampis a floating-point Unix timestampvalueis the numeric value extracted from the specified key (or the first field ifKeyisn't specified)
The plugin only supports numeric values (integers or floats). If the specified key isn't found or the value isn't numeric, an error is logged and the record is skipped.
Get started
You can run the plugin from the command line or through the configuration file.
Command line
From the command line you can generate plot data files with the following options:
This example extracts the cpu_p field from CPU metrics and writes timestamp-value pairs to cpu_data.dat.
Configuration file
In your main configuration file append the following:
Example usage with gnuplot
gnuplotAfter generating the data file with Fluent Bit, you can use gnuplot to visualize the data:
Generate the data file:
This command collects CPU metrics, extracts the cpu_p field (CPU percentage), and writes timestamp-value pairs to cpu_data.dat. The output file will contain lines like:
Create a
gnuplotscript (for example,plot.gp):
Run
gnuplot:
This will generate a PNG image file showing the CPU usage over time.
Last updated
Was this helpful?