sadf
Export system activity data in various formats
SYNOPSIS
sadf [ options ] [ sa_file [ ... ] ]
PARAMETERS
-c
Convert sa_file from current system activity file format to current format.
-d
Print data with delimiters
-H
Display header. (useful with -d parameter)
-j
Print data in JSON format
-J {name}
Print data in JSON format, using name as the name of the main JSON object.
-p
Print data in a parsable (sadc) format.
-P {cpu[,...] | ALL}
Indicate processor(s) for which statistics are to be reported.
-s {hh:mm[:ss]}
Set the beginning time for the report.
-e {hh:mm[:ss]}
Set the ending time for the report.
-t
When using -j or -x options, display timestamp in seconds instead of Epoch date.
-x
Print data in XML format.
-X {name}
Print data in XML format, using name as the root tag's name.
-O { opts }
Use the options to select the output format.
DESCRIPTION
sadf is designed to be a SAR data extraction tool, outputting data collected by sadc in formats easily ingestible by other programs. The sar command can display data in human readable format. sadf is able to output data in multiple formats including CSV, JSON, XML, and more, making it ideal for automated data processing and reporting. The primary function of sadf is to parse the binary data files generated by sadc, the data collection backend typically scheduled via cron job, and to present this information in a structured, machine-parseable manner. This allows for seamless integration with scripting languages, databases, and data visualization tools for advanced system performance monitoring and analysis.
It provides efficient access to historical system performance metrics without requiring manual intervention.
sadf offers flexibility in specifying the time range and specific data series to be extracted, minimizing the amount of data processed and improving efficiency.
CAVEATS
While sadf provides a powerful mechanism for extracting data, it's crucial to ensure that the data files being processed are not corrupted or incomplete. Also, interpreting the output correctly requires a solid understanding of the underlying system performance metrics being collected by sadc.
DATA FILES
sadf operates on the system activity data files created by sadc. These files are typically located in /var/log/sa/, with naming conventions like saDD for the data of the DDth day of the month.
EXIT STATUS
Returns 0 upon successful execution, and a non-zero value if it encounters any errors
HISTORY
sadf is a relatively recent addition to the sysstat package, designed to address the need for programmatically accessing the historical data collected by sadc and sar. Previously, parsing the raw data files required custom scripting, which was cumbersome and error-prone. sadf provides a standardized, reliable interface, enhancing automation and integration with other monitoring tools.