SADF(1)
โจ NAME โจ
sadf โ literally the tool that displays all the data sar collected, but in like a million different formats ๐
(this is sadf(1) from the Linux User's Manual, hi bestie ๐ซถ)
๐ธ SYNOPSIS ๐ธ
sadf [ -C ] [ -c | -d | -g | -j | -l | -p | -r | -x ] [ -H ] [ -h ] [ -T
| -t | -U ] [ -V ] [ -O opts [,...] ] [ -P { cpu_list | ALL } ] [ -s [
start_time ] ] ] [ -e [ end_time ] ] ] [ --dev=dev_list ] [ --fs=fs_list
] [ --iface=iface_list] [ --int=int_list ] [ -- sar_options ] [ interval
[ count ] ] [ datafile | -[0-9]+ ]
๐ฆ DESCRIPTION ๐ฆ
Okay so sadf is the main character that shows you what's inside the data files that sar(1) made ๐. But here's the plot twist: unlike sar, sadf can write that data out in so many different formats โ CSV, XML, and more โ it's giving versatility, honestly. The default format is the kind that pattern-processing commands like awk can handle super easily (peep option -p ๐). And sadf can also draw graphs for all the activities sar collected and show them as SVG (Scalable Vector Graphics) graphics right in your web browser (peep option -g ๐จ).
sadf extracts those records saved in the datafile file and writes them to standard output. That file has to have been created by a version of sar that's compatible with your version of sadf, no cap โ mismatched versions are not the vibe ๐ญ. If datafile is left out, sadf uses the standard system activity daily data file instead. You can also pass -1, -2 etc. as an argument to sadf to see the data from that many days ago โ like, -1 points at yesterday's standard system activity file. Obsessed, actually โจ.
The standard system activity daily data file is named saDD or saYYYYMMDD, where YYYY is the current year, MM is the current month and DD is the current day. sadf looks for the most recent of saDD and saYYYYMMDD, and uses it. By default it lives in the /var/log/sa directory. But you can point it somewhere else: if datafile is a directory (instead of a plain file), then it gets treated as the directory where the standard system activity daily data file is located ๐๏ธ.
The interval and count parameters tell sadf to select count records at interval seconds apart. If count isn't set, then literally all the records saved in the data file get displayed. All of them. The whole thing. ๐
Here's the part where you gotta be careful bestie ๐: all the activity flags of sar can be entered on the command line to say which activities get reported. But before you specify them, put a pair of dashes (--) on the command line so the flags don't get confused with sadf's own flags. Not specifying any flags selects only CPU activity โ that's the default, periodt.
๐ OPTIONS ๐
-Cโ Tellssadfto display the comments that are present in the file ๐ฌ.-cโ Converts an old system activity binary datafile (version9.1.6and later) to the current up-to-date format. Use this syntax, exactly:
sadf -c old_datafile > new_datafile
The conversion can be controlled using option -O (scroll down, it's there ๐ซถ).
-dโ Prints the contents of the data file in a format that a relational database system can ingest super easily. The output is fields separated by a semicolon. Each record contains the hostname of the host where the file was created, the interval value (or-1if it's not applicable), the timestamp in a form that most databases will happily accept, plus additional semicolon-separated data fields as specified by the sar_options command line options. Note that the timestamp output can be controlled by options-T,-tand-Uโฐ.--dev=dev_list โ Specifies the block devices whose statisticssadfshould display. dev_list is a list of comma-separated device names. Useful with option-dfromsar๐พ.-e [hh:mm[:ss]]-e [seconds_since_the_epoch]โ Sets the ending time of the report. The default ending time is18:00:00. Hours must be given in 24-hour format, or as the number of seconds since the epoch (given as a 10 digit number) ๐.--fs=fs_list โ Specifies the filesystems whose statisticssadfshould display. fs_list is a list of comma-separated filesystem device names and/or mountpoints. Either form is accepted for filtering โ both work, iykyk. Useful with option-Ffromsar๐๏ธ.-gโ Prints the contents of the data file in SVG (Scalable Vector Graphics) format. This option lets you display some fancy graphs in your web browser ๐. Use this syntax:
sadf -g your_datafile [ -- sar_options ] > output.svg
and then open the resulting SVG file in your favorite web browser. The output can be controlled using option -O (again, it's below ๐).
-Hโ Displays only the header of the report (when applicable). If no format has been specified, then the header data (the metadata) of the data file is what gets displayed ๐ท๏ธ.-hโ When used together with option-d, all activities get displayed horizontally on a single line. One line. Everything. Slay ๐.--iface=iface_list โ Specifies the network interfaces whose statisticssadfshould display. iface_list is a list of comma-separated interface names. Useful with options-n DEVand-n EDEVfromsar๐.--int=int_list โ Specifies the interrupts names whose statisticssadfshould display. int_list is a list of comma-separated values or range of values (e.g.,0-16,35,40-). Useful with option-Ifromsarโก.-jโ Prints the contents of the data file in JSON (JavaScript Object Notation) format. Timestamps can be controlled by options-Tand-t๐งพ.-lโ Exports the contents of the data file to a PCP (Performance Co-Pilot) archive. The name of the archive can be specified using the keywordpcparchive=with option-O๐ฆ.-Oopts[,...]โ Uses the specified options to control the output ofsadf. The following options control the SVG output displayed bysadf -g:autoscaleโ Draws all the graphs of a given view as large as possible based on the current view's scale. To do this, a factor (10,100,1000...) is used to enlarge the graph drawing. This option may be interesting when several graphs are drawn on the same view, some with only very small values, and others with high ones โ the high ones making the small ones hardly visible ๐ญ.bwcolโ Uses a black and white palette to draw the graphs ๐ค๐ค.customcolโ Uses a customizable color palette instead of the default one to draw the graphs. See environment variableS_COLORS_PALETTEbelow to know how to customize that palette ๐จ.debugโ Adds helpful comments in the SVG output file ๐.height=value โ Sets the SVG canvas height to value ๐.onedayโ Displays graphs data over a period of 24 hours. Note that hours are still printed in UTC by default: you should use option-Tto print them in local time and get a time window starting from midnight ๐.packedโ Groups all views from the same activity (and for the same device) on the same row ๐งณ.showidleโ Also displays the%idlestate in graphs for CPU statistics ๐ค.showinfoโ Displays additional information (such as the date and the host name) on each view โน๏ธ.showtocโ Adds a table of contents at the beginning of the SVG output, consisting of links pointing at the first graph of each activity ๐.skipemptyโ Does not display views where all graphs have only zero values ๐ซ.
The following option may be used when converting an old system activity binary datafile to current up-to-date format:
hz=value โ Specifies the number of ticks per second for the machine where the old datafile has been created โฑ๏ธ.
The following option may be used when data are exported to a PCP archive:
pcparchive=name โ Specifies the name of the PCP archive to create ๐๏ธ.
The following option is used to control raw output displayed by sadf -r:
debugโ Displays additional information, mainly useful for debugging purposes ๐.
-P {cpu_list| ALL }โ Tellssadfthat processor-dependent statistics are to be reported only for the specified processor or processors. cpu_list is a list of comma-separated values or range of values (e.g.,0,2,4-7,12-). Note that processor0is the first processor, and processorallis the global average among all processors. Specifying theALLkeyword reports statistics for each individual processor, and globally for all processors ๐ฅ๏ธ.-pโ Prints the contents of the data file in a format that pattern processing commands likeawkcan handle super easily. The output is fields separated by a tab. Each record contains the hostname of the host where the file was created, the interval value (or-1if not applicable), the timestamp, the device name (or-if not applicable), the field name and its value. Note that the timestamp output can be controlled by options-T,-tand-Uโฐ.-rโ Prints the raw contents of the data file. With this format, the values for all the counters are displayed as read from the kernel, which means e.g. that no average values are calculated over the elapsed time interval โ it's the raw realness, no smoothing ๐ง. The output can be controlled using option-O(see above).-s [hh:mm[:ss]]-s [seconds_since_the_epoch]โ Sets the starting time of the report. The default starting time is08:00:00. Hours must be given in 24-hour format, or as the number of seconds since the epoch (given as a 10 digit number) ๐.-Tโ Displays the timestamp in local time instead of UTC (Coordinated Universal Time) ๐ฐ๏ธ.-tโ Displays the timestamp in the original local time of the data file creator instead of UTC (Coordinated Universal Time) ๐.-Uโ Displays the timestamp (UTC โ Coordinated Universal Time) in seconds from the epoch ๐ข.-Vโ Prints the version number then exits. Short and iconic ๐.-xโ Prints the contents of the data file in XML format. Timestamps can be controlled by options-Tand-t. The corresponding DTD (Document Type Definition) and XML Schema are included in the sysstat source package. They're also available athttps://sysstat.github.io/๐.
โจ ENVIRONMENT โจ
okay bestie, sadf also peeks at your environment variables ๐ here's the whole roster:
S_COLORS_PALETTEโ this one sets the colors thatsadf -guses to render the SVG output. big caveat: it's only taken into account when you've picked the custom color palette with the optioncustomcol(see option-O). its value is a colon-separated list of capabilities mapped to six-digit, three-byte hexadecimal numbers (hex triplets) representing colors, and it defaults to:
0=000000:1=1a1aff:2=1affb2:3=b21aff:
4=1ab2ff:5=ff1a1a:6=ffb31a:7=b2ff1a:
8=efefef:9=000000:A=1a1aff:B=1affb2:
C=b21aff:D=1ab2ff:E=ff1a1a:F=ffb31a:
G=bebebe:H=000000:I=000000:K=ffffff:
L=000000:T=000000:W=000000:X=000000
capabilities that are just a single hexadecimal digit (0 through F) specify the first sixteen colors in the palette โ those are the ones used to draw the graphs ๐จ so like, 3=ffffff would mean the third color in the palette is white (0xffffff). the other capabilities are:
G=โ the color used to draw the grid lines.H=โ the color used to display the report header.I=โ the color used to display additional information (e.g., date, hostname...).K=โ the color used for the graphs background.L=โ the default color (which is for example used to display the table of contents).T=โ the color used to display the graphs title.W=โ the color used to display warning and error messages.X=โ the color used to draw the axes and display the graduations.
S_TIME_DEF_TIMEโ if this variable exists and its value isUTC, thensadfwill use UTC time instead of local time to figure out which current daily data file lives in the/var/log/sadirectory. clock stuff, iykyk ๐ฐ๏ธ
๐ธ EXAMPLES ๐ธ
real ones, in action:
sadf -d /var/log/sa/sa21 -- -r -n DEV
extract memory and network statistics from the system activity file sa21, and display them in a format that can be ingested by a database. literally feeding your db, no cap ๐พ
sadf -p -P 1
extract CPU statistics for processor 1 (the second processor, yes, zero-indexed bestie ๐ญ) from the current daily data file, and display them in a format that can easily be handled by a pattern processing command. grep girlies rejoice ๐ซถ
๐ BUGS ๐
so the SVG output (as created by option -g) is fully compliant with the SVG 1.1 standard. graphics have been successfully displayed in various web browsers, including Firefox, Chrome and Opera. but โ and I cannot stress this enough โ SVG rendering is broken on Microsoft browsers (tested on Internet Explorer 11 and Edge 13.1). so please don't use them. like, don't. I'm begging ๐
๐ FILES ๐
/var/log/sa/saDD/var/log/sa/saYYYYMMDD
these are the standard system activity daily data files and their default location. YYYY stands for the current year, MM for the current month and DD for the current day. that's the whole naming scheme, iconic and simple โจ
๐ AUTHOR ๐
Sebastien Godard (sysstat <at> orange.fr) โ the main character who made all this happen ๐
๐ SEE ALSO ๐
sar(1), sadc(8), sa1(8), sa2(8), sysstat(5)
and if you wanna stan further:
okay that's the whole page bestie, you're fully caught up ๐ซถ this one's from the Linux manual, AUGUST 2026, and it's the SADF(1) page โ go forth and sadf responsibly, ily, mwah ๐โจ๐
๐ฆ where this page comes from
- arch rolling: sysstat 12.8.0-1 ยท GPL-2.0-only
- nixpkgs unstable: sysstat 12.8.0
- (C) 1999-2026 Sebastien Godard (sysstat <at> orange.fr)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms