{
    "content": [
        {
            "type": "text",
            "text": "# sadf(1) (man)\n\n**Summary:** sadf - Display data collected by sar in multiple formats.\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -C | — | — |  |\n| -c | — | — | up-to-date format. Use the following syntax: sadf -c olddatafile > newdatafile Conversion can be controlled using option |\n| -d | — | — | tional database system. The output consists of fields separated by a semicolon. Each record contains the hostname of the |\n| -e | — | — | Set the ending time of the report. The default ending time is 18:00:00. Hours must be given in 24-hour format. --fs=fsli |\n| -g | — | — | option enables you to display some fancy graphs in your web browser. Use the follow‐ ing syntax: sadf -g yourdatafile [  |\n| -H | — | — | fied, then the header data (metadata) of the data file are displayed. |\n| -d | — | — | on a single line. --iface=ifacelist Specify the network interfaces for which statistics are to be displayed by sadf. ifa |\n| -j | — | — | stamps can be controlled by options -T and -t. |\n| -l | — | — | name of the archive can be specified using the keyword pcparchive= with option -O. |\n| -O | — | — | Use the specified options to control the output of sadf. The following options are used to control SVG output displayed  |\n| -P | — | — | Tell sadf that processor dependent statistics are to be reported only for the speci‐ fied processor or processors. cpuli |\n| -p | — | — | processing commands like awk. The output consists of fields separated by a tab. Each record contains the hostname of the |\n| -r | — | — | counters are displayed as read from the kernel, which means e.g., that no average val‐ ues are calculated over the elaps |\n| -s | — | — | Set the starting time of the data, causing the sadf command to extract records time-tagged at, or following, the time sp |\n| -T | — | — |  |\n| -t | — | — | (Coordinated Universal Time). |\n| -U | — | — |  |\n| -V | — | — |  |\n| -x | — | — | options -T and -t. The corresponding DTD (Document Type Definition) and XML Schema are included in the sysstat source pa |\n\n## Examples\n\n- `Extract memory and network statistics from system activity file sa21, and display them`\n- `in a format that can be ingested by a database.`\n- `Extract CPU statistics for processor 1 (the second processor) from current daily  data`\n- `file,  and display them in a format that can easily be handled by a pattern processing`\n- `command.`\n\n## See Also\n\n- sar(1)\n- sadc(8)\n- sa1(8)\n- sa2(8)\n- sysstat(5)\n\n## Section Outline\n\n- **NAME** (3 lines)\n- **SYNOPSIS** (1 lines) — 2 subsections\n  - sadf [ -C ] [ -c | -d | -g | -j | -l | -p | -r | -x ] [ -H ] (1 lines)\n  - -O -P -s -e (4 lines)\n- **DESCRIPTION** (30 lines)\n- **OPTIONS** (1 lines) — 19 subsections\n  - -C (1 lines)\n  - -c (6 lines)\n  - -d (11 lines)\n  - -e (8 lines)\n  - -g (8 lines)\n  - -H (2 lines)\n  - -h -d (7 lines)\n  - -j (2 lines)\n  - -l (2 lines)\n  - -O (57 lines)\n  - -P (6 lines)\n  - -p (6 lines)\n  - -r (4 lines)\n  - -s (4 lines)\n  - -T (1 lines)\n  - -t (2 lines)\n  - -U (1 lines)\n  - -V (1 lines)\n  - -x (5 lines)\n- **ENVIRONMENT** (45 lines)\n- **EXAMPLES** (1 lines) — 2 subsections\n  - sadf -d /var/log/sysstat/sa21 -- -r -n DEV (3 lines)\n  - sadf -p -P 1 (5 lines)\n- **BUGS** (6 lines)\n- **FILES** (6 lines)\n- **AUTHOR** (3 lines)\n- **SEE ALSO** (8 lines)\n\n## Full Content\n\n### NAME\n\nsadf - Display data collected by sar in multiple formats.\n\n### SYNOPSIS\n\n#### sadf [ -C ] [ -c | -d | -g | -j | -l | -p | -r | -x ] [ -H ] [ -h ] [ -T | -t | -U ] [ -V ] [\n\n#### -O -P -s -e\n\n--dev=devlist ] [ --fs=fslist ] [ --iface=ifacelist] [ -- saroptions ] [ interval [ count\n] ] [ datafile | -[0-9]+ ]\n\n### DESCRIPTION\n\nThe sadf command is used for displaying the contents of data files created by the sar(1) com‐\nmand. But unlike sar, sadf can write its data in many different formats (CSV, XML, etc.)  The\ndefault format is one that can easily be handled by pattern processing commands like awk (see\noption  -p). The sadf command can also be used to draw graphs for the various activities col‐\nlected by sar and display them as SVG (Scalable Vector Graphics) graphics in your web browser\n(see option -g).\n\nThe  sadf  command extracts and writes to standard output records saved in the datafile file.\nThis file must have been created by a version of sar which is compatible with that  of  sadf.\nIf  datafile  is omitted, sadf uses the standard system activity daily data file.  It is also\npossible to enter -1, -2 etc. as an argument to sadf to display data of that  days  ago.  For\nexample, -1 will point at the standard system activity file of yesterday.\n\nThe  standard  system activity daily data file is named saDD or saYYYYMMDD, where YYYY stands\nfor the current year, MM for the current month and DD for the current day.   sadf  will  look\nfor  the  most  recent  of  saDD  and saYYYYMMDD, and use it. By default it is located in the\n/var/log/sysstat directory. Yet it is possible to specify an alternate location  for  it:  If\ndatafile is a directory (instead of a plain file) then it will be considered as the directory\nwhere the standard system activity daily data file is located.\n\nThe interval and count parameters are used to tell sadf to select count records  at  interval\nseconds apart. If the count parameter is not set, then all the records saved in the data file\nwill be displayed.\n\nAll the activity flags of sar may be entered on the command line to indicate which activities\nare  to be reported. Before specifying them, put a pair of dashes (--) on the command line in\norder not to confuse the flags with those of sadf.  Not specifying any flags selects only CPU\nactivity.\n\n### OPTIONS\n\n#### -C\n\n#### -c\n\nup-to-date format. Use the following syntax:\n\nsadf -c olddatafile > newdatafile\n\nConversion can be controlled using option -O (see below).\n\n#### -d\n\ntional  database  system. The output consists of fields separated by a semicolon. Each\nrecord contains the hostname of the host where the  file  was  created,  the  interval\nvalue  (or  -1  if  not applicable), the timestamp in a form easily acceptable by most\ndatabases, and additional semicolon separated data fields as specified by  saroptions\ncommand  line options.  Note that timestamp output can be controlled by options -T, -t\nand -U.\n\n--dev=devlist\nSpecify the block devices for which statistics are to be displayed by sadf.   devlist\nis a list of comma-separated device names. Useful with option -d from sar.\n\n#### -e\n\nSet  the ending time of the report. The default ending time is 18:00:00. Hours must be\ngiven in 24-hour format.\n\n--fs=fslist\nSpecify the filesystems for which statistics are to be displayed by sadf.  fslist  is\na  list of comma-separated filesystem names or mountpoints. Useful with option -F from\nsar.\n\n#### -g\n\noption  enables you to display some fancy graphs in your web browser.  Use the follow‐\ning syntax:\n\nsadf -g yourdatafile [ -- saroptions ] > output.svg\n\nand open the resulting SVG file in your favorite web  browser.   Output  can  be  con‐\ntrolled using option -O (see below).\n\n#### -H\n\nfied, then the header data (metadata) of the data file are displayed.\n\n#### -h -d\n\non a single line.\n\n--iface=ifacelist\nSpecify  the  network  interfaces  for  which  statistics are to be displayed by sadf.\nifacelist is a list of comma-separated interface names. Useful with  options  -n  DEV\nand -n EDEV from sar.\n\n#### -j\n\nstamps can be controlled by options -T and -t.\n\n#### -l\n\nname of the archive can be specified using the keyword pcparchive= with option -O.\n\n#### -O\n\nUse  the  specified  options to control the output of sadf.  The following options are\nused to control SVG output displayed by sadf -g:\n\nautoscale\nDraw all the graphs of a given view as  large  as  possible  based  on  current\nview's  scale.  To  do this, a factor (10, 100, 1000...) is used to enlarge the\ngraph drawing.  This option may be interesting when several graphs are drawn on\nthe same view, some with only very small values, and others with high ones, the\nlatter making the former hardly visible.\n\nbwcol  Use a black and white palette to draw the graphs.\n\ncustomcol\nUse a customizable color palette instead of the default one to draw the graphs.\nSee  environment  variable SCOLORSPALETTE below to know how to customize that\npalette.\n\nheight=value\nSet SVG canvas height to value.\n\noneday Display graphs data over a period of  24  hours.  Note  that  hours  are  still\nprinted in UTC by default: You should use option -T to print them in local time\nand get a time window starting from midnight.\n\npacked Group all views from the same activity (and for the same device)  on  the  same\nrow.\n\nshowidle\nAlso display %idle state in graphs for CPU statistics.\n\nshowinfo\nDisplay  additional  information  (such  as the date and the host name) on each\nview.\n\nshowtoc\nAdd a table of contents at the beginning of the SVG output, consisting of links\npointing at the first graph of each activity.\n\nskipempty\nDo not display views where all graphs have only zero values.\n\nThe  following  option  may  be  used  when  converting  an old system activity binary\ndatafile to current up-to-date format:\n\nhz=value\nSpecify the number of ticks per second for the machine where the  old  datafile\nhas been created.\n\nThe following option may be used when data are exported to a PCP archive:\n\npcparchive=name\nSpecify the name of the PCP archive to create.\n\nThe following option is used to control raw output displayed by sadf -r:\n\ndebug  Display additional information, mainly useful for debugging purpose.\n\n#### -P\n\nTell  sadf  that processor dependent statistics are to be reported only for the speci‐\nfied processor or processors.  cpulist is a list of comma-separated values  or  range\nof values (e.g., 0,2,4-7,12-).  Note that processor 0 is the first processor, and pro‐\ncessor all is the global average among all processors. Specifying the ALL keyword  re‐\nports statistics for each individual processor, and globally for all processors.\n\n#### -p\n\nprocessing commands like awk.  The output consists of fields separated by a tab.  Each\nrecord  contains  the  hostname  of  the host where the file was created, the interval\nvalue (or -1 if not applicable), the timestamp, the device name (or - if not  applica‐\nble),  the  field name and its value.  Note that timestamp output can be controlled by\noptions -T, -t and -U.\n\n#### -r\n\ncounters are displayed as read from the kernel, which means e.g., that no average val‐\nues are calculated over the elapsed time interval.  Output can be controlled using op‐\ntion -O (see above).\n\n#### -s\n\nSet  the  starting  time  of  the  data,  causing  the sadf command to extract records\ntime-tagged at, or following,  the  time  specified.  The  default  starting  time  is\n08:00:00.  Hours must be given in 24-hour format.\n\n#### -T\n\n#### -t\n\n(Coordinated Universal Time).\n\n#### -U\n\n#### -V\n\n#### -x\n\noptions  -T  and  -t.  The corresponding DTD (Document Type Definition) and XML Schema\nare included in the sysstat source package. They are also available  at  http://pages‐\nperso-orange.fr/sebastien.godard/download.html.\n\n### ENVIRONMENT\n\nThe sadf command takes into account the following environment variables:\n\nSCOLORSPALETTE\nSpecify the colors used by sadf -g to render the SVG output. This environment variable\nis taken into account only when the custom color palette has been  selected  with  the\noption customcol (see option -O).  Its value is a colon-separated list of capabilities\nassociated with six-digit, three-byte hexadecimal numbers (hex triplets)  representing\ncolors that defaults to\n\n0=000000:1=1a1aff:2=1affb2:3=b21aff:\n4=1ab2ff:5=ff1a1a:6=ffb31a:7=b2ff1a:\n8=efefef:9=000000:A=1a1aff:B=1affb2:\nC=b21aff:D=1ab2ff:E=ff1a1a:F=ffb31a:\nG=bebebe:H=000000:I=000000:K=ffffff:\nL=000000:T=000000:W=000000:X=000000\n\nCapabilities  consisting of an hexadecimal digit (0 through F) are used to specify the\nfirst sixteen colors in the palette (these colors are used to draw the graphs),  e.g.,\n3=ffffff would indicate that the third color in the palette is white (0xffffff).\nOther capabilities are:\n\nG=     Specify the color used to draw the grid lines.\n\nH=     Specify the color used to display the report header.\n\nI=     Specify  the  color  used  to display additional information (e.g., date, host‐\nname...)\n\nK=     Specify the color used for the graphs background.\n\nL=     Specify the default color (which is for example used to display  the  table  of\ncontents).\n\nT=     Specify the color used to display the graphs title.\n\nW=     Specify the color used to display warning and error messages.\n\nX=     Specify the color used to draw the axes and display the graduations.\n\nSTIMEDEFTIME\nIf  this  variable  exists and its value is UTC then sadf will use UTC time instead of\nlocal time to determine the current daily data file located  in  the  /var/log/sysstat\ndirectory.\n\n### EXAMPLES\n\n#### sadf -d /var/log/sysstat/sa21 -- -r -n DEV\n\nExtract memory and network statistics from system activity file sa21, and display them\nin a format that can be ingested by a database.\n\n#### sadf -p -P 1\n\nExtract CPU statistics for processor 1 (the second processor) from current daily  data\nfile,  and display them in a format that can easily be handled by a pattern processing\ncommand.\n\n### BUGS\n\nSVG output (as created by option -g) is fully compliant with SVG 1.1 standard.  Graphics have\nbeen successfully displayed in various web browsers, including Firefox, Chrome and Opera. Yet\nSVG rendering is broken on Microsoft browsers (tested on Internet Explorer 11 and Edge 13.1):\nSo please don't use them.\n\n### FILES\n\n/var/log/sysstat/saDD\n/var/log/sysstat/saYYYYMMDD\nThe standard system activity daily data files and their default location.  YYYY stands\nfor the current year, MM for the current month and DD for the current day.\n\n### AUTHOR\n\nSebastien Godard (sysstat <at> orange.fr)\n\n### SEE ALSO\n\nsar(1), sadc(8), sa1(8), sa2(8), sysstat(5)\n\nhttps://github.com/sysstat/sysstat\nhttp://pagesperso-orange.fr/sebastien.godard/\n\n\n\nLinux                                         JULY 2020                                      SADF(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "sadf",
        "section": "1",
        "mode": "man",
        "summary": "sadf - Display data collected by sar in multiple formats.",
        "synopsis": "",
        "flags": [
            {
                "flag": "-C",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": "up-to-date format. Use the following syntax: sadf -c olddatafile > newdatafile Conversion can be controlled using option -O (see below)."
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "tional database system. The output consists of fields separated by a semicolon. Each record contains the hostname of the host where the file was created, the interval value (or -1 if not applicable), the timestamp in a form easily acceptable by most databases, and additional semicolon separated data fields as specified by saroptions command line options. Note that timestamp output can be controlled by options -T, -t and -U. --dev=devlist Specify the block devices for which statistics are to be displayed by sadf. devlist is a list of comma-separated device names. Useful with option -d from sar."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "Set the ending time of the report. The default ending time is 18:00:00. Hours must be given in 24-hour format. --fs=fslist Specify the filesystems for which statistics are to be displayed by sadf. fslist is a list of comma-separated filesystem names or mountpoints. Useful with option -F from sar."
            },
            {
                "flag": "-g",
                "long": null,
                "arg": null,
                "description": "option enables you to display some fancy graphs in your web browser. Use the follow‐ ing syntax: sadf -g yourdatafile [ -- saroptions ] > output.svg and open the resulting SVG file in your favorite web browser. Output can be con‐ trolled using option -O (see below)."
            },
            {
                "flag": "-H",
                "long": null,
                "arg": null,
                "description": "fied, then the header data (metadata) of the data file are displayed."
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "on a single line. --iface=ifacelist Specify the network interfaces for which statistics are to be displayed by sadf. ifacelist is a list of comma-separated interface names. Useful with options -n DEV and -n EDEV from sar."
            },
            {
                "flag": "-j",
                "long": null,
                "arg": null,
                "description": "stamps can be controlled by options -T and -t."
            },
            {
                "flag": "-l",
                "long": null,
                "arg": null,
                "description": "name of the archive can be specified using the keyword pcparchive= with option -O."
            },
            {
                "flag": "-O",
                "long": null,
                "arg": null,
                "description": "Use the specified options to control the output of sadf. The following options are used to control SVG output displayed by sadf -g: autoscale Draw all the graphs of a given view as large as possible based on 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 latter making the former hardly visible. bwcol Use a black and white palette to draw the graphs. customcol Use a customizable color palette instead of the default one to draw the graphs. See environment variable SCOLORSPALETTE below to know how to customize that palette. height=value Set SVG canvas height to value. oneday Display graphs data over a period of 24 hours. Note that hours are still printed in UTC by default: You should use option -T to print them in local time and get a time window starting from midnight. packed Group all views from the same activity (and for the same device) on the same row. showidle Also display %idle state in graphs for CPU statistics. showinfo Display additional information (such as the date and the host name) on each view. showtoc Add a table of contents at the beginning of the SVG output, consisting of links pointing at the first graph of each activity. skipempty Do 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 Specify 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 Specify the name of the PCP archive to create. The following option is used to control raw output displayed by sadf -r: debug Display additional information, mainly useful for debugging purpose."
            },
            {
                "flag": "-P",
                "long": null,
                "arg": null,
                "description": "Tell sadf that processor dependent statistics are to be reported only for the speci‐ fied processor or processors. cpulist is a list of comma-separated values or range of values (e.g., 0,2,4-7,12-). Note that processor 0 is the first processor, and pro‐ cessor all is the global average among all processors. Specifying the ALL keyword re‐ ports statistics for each individual processor, and globally for all processors."
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "processing commands like awk. The output consists of fields separated by a tab. Each record contains the hostname of the host where the file was created, the interval value (or -1 if not applicable), the timestamp, the device name (or - if not applica‐ ble), the field name and its value. Note that timestamp output can be controlled by options -T, -t and -U."
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "counters are displayed as read from the kernel, which means e.g., that no average val‐ ues are calculated over the elapsed time interval. Output can be controlled using op‐ tion -O (see above)."
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": "Set the starting time of the data, causing the sadf command to extract records time-tagged at, or following, the time specified. The default starting time is 08:00:00. Hours must be given in 24-hour format."
            },
            {
                "flag": "-T",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": "(Coordinated Universal Time)."
            },
            {
                "flag": "-U",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "options -T and -t. The corresponding DTD (Document Type Definition) and XML Schema are included in the sysstat source package. They are also available at http://pages‐ perso-orange.fr/sebastien.godard/download.html."
            }
        ],
        "examples": [
            "Extract memory and network statistics from system activity file sa21, and display them",
            "in a format that can be ingested by a database.",
            "Extract CPU statistics for processor 1 (the second processor) from current daily  data",
            "file,  and display them in a format that can easily be handled by a pattern processing",
            "command."
        ],
        "see_also": [
            {
                "name": "sar",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/sar/1/json"
            },
            {
                "name": "sadc",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sadc/8/json"
            },
            {
                "name": "sa1",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sa1/8/json"
            },
            {
                "name": "sa2",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sa2/8/json"
            },
            {
                "name": "sysstat",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/sysstat/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "sadf [ -C ] [ -c | -d | -g | -j | -l | -p | -r | -x ] [ -H ] [ -h ] [ -T | -t | -U ] [ -V ] [",
                        "lines": 1
                    },
                    {
                        "name": "-O -P -s -e",
                        "lines": 4,
                        "flag": "-e"
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-C",
                        "lines": 1,
                        "flag": "-C"
                    },
                    {
                        "name": "-c",
                        "lines": 6,
                        "flag": "-c"
                    },
                    {
                        "name": "-d",
                        "lines": 11,
                        "flag": "-d"
                    },
                    {
                        "name": "-e",
                        "lines": 8,
                        "flag": "-e"
                    },
                    {
                        "name": "-g",
                        "lines": 8,
                        "flag": "-g"
                    },
                    {
                        "name": "-H",
                        "lines": 2,
                        "flag": "-H"
                    },
                    {
                        "name": "-h -d",
                        "lines": 7,
                        "flag": "-d"
                    },
                    {
                        "name": "-j",
                        "lines": 2,
                        "flag": "-j"
                    },
                    {
                        "name": "-l",
                        "lines": 2,
                        "flag": "-l"
                    },
                    {
                        "name": "-O",
                        "lines": 57,
                        "flag": "-O"
                    },
                    {
                        "name": "-P",
                        "lines": 6,
                        "flag": "-P"
                    },
                    {
                        "name": "-p",
                        "lines": 6,
                        "flag": "-p"
                    },
                    {
                        "name": "-r",
                        "lines": 4,
                        "flag": "-r"
                    },
                    {
                        "name": "-s",
                        "lines": 4,
                        "flag": "-s"
                    },
                    {
                        "name": "-T",
                        "lines": 1,
                        "flag": "-T"
                    },
                    {
                        "name": "-t",
                        "lines": 2,
                        "flag": "-t"
                    },
                    {
                        "name": "-U",
                        "lines": 1,
                        "flag": "-U"
                    },
                    {
                        "name": "-V",
                        "lines": 1,
                        "flag": "-V"
                    },
                    {
                        "name": "-x",
                        "lines": 5,
                        "flag": "-x"
                    }
                ]
            },
            {
                "name": "ENVIRONMENT",
                "lines": 45,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "sadf -d /var/log/sysstat/sa21 -- -r -n DEV",
                        "lines": 3
                    },
                    {
                        "name": "sadf -p -P 1",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 8,
                "subsections": []
            }
        ]
    }
}