1SADF(1) Linux User's Manual SADF(1)
2
3
4
6 sadf - Display data collected by sar in multiple formats.
7
9 sadf [ -C ] [ -d | -j | -p | -x ] [ -H ] [ -h ] [ -T | -t | -U ] [ -V ]
10 [ -P { cpu [,...] | ALL } ] [ -s [ hh:mm:ss ] ] [ -e [ hh:mm:ss ] ] [
11 -- sar_options ] [ interval [ count ] ] [ datafile ]
12
14 The sadf command is used for displaying the contents of data files cre‐
15 ated by the sar(1) command. But unlike sar, sadf can write its data in
16 many different formats (CSV, XML, etc.) The default format is one that
17 can easily be handled by pattern processing commands like awk (see
18 option -p).
19
20 The sadf command extracts and writes to standard output records saved
21 in the datafile file. This file must have been created by a version of
22 sar which is compatible with that of sadf. If datafile is omitted,
23 sadf uses the standard system activity file, the /var/log/sa/sadd file,
24 where the dd parameter indicates the current day.
25
26 The interval and count parameters are used to tell sadf to select count
27 records at interval seconds apart. If the count parameter is not set,
28 then all the records saved in the data file will be displayed.
29
30 All the activity flags of sar may be entered on the command line to
31 indicate which activities are to be reported. Before specifying them,
32 put a pair of dashes (--) on the command line in order not to confuse
33 the flags with those of sadf. Not specifying any flags selects only
34 CPU activity.
35
36
38 -C Tell sadf to display comments present in file.
39
40 -d Print the contents of the data file in a format that can easily
41 be ingested by a relational database system. The output consists
42 of fields separated by a semicolon. Each record contains the
43 hostname of the host where the file was created, the interval
44 value (or -1 if not applicable), the timestamp in a form easily
45 acceptable by most databases, and additional semicolon separated
46 data fields as specified by sar_options command line options.
47 Note that timestamp output can be controlled by options -T, -t
48 and -U.
49
50 -e [ hh:mm:ss ]
51 Set the ending time of the report, given in local time. The
52 default ending time is 18:00:00. Hours must be given in 24-hour
53 format.
54
55 -H Display only the header of the report (when applicable). If no
56 format has been specified, then the header of the data file is
57 displayed.
58
59 -h When used in conjunction with option -d, all activities will be
60 displayed horizontally on a single line.
61
62 -j Print the contents of the data file in JSON (JavaScript Object
63 Notation) format. Timestamps can be controlled by options -T and
64 -t.
65
66 -P { cpu [,...] | ALL }
67 Tell sadf that processor dependent statistics are to be reported
68 only for the specified processor or processors. Specifying the
69 ALL keyword reports statistics for each individual processor,
70 and globally for all processors. Note that processor 0 is the
71 first processor.
72
73 -p Print the contents of the data file in a format that can easily
74 be handled by pattern processing commands like awk. The output
75 consists of fields separated by a tab. Each record contains the
76 hostname of the host where the file was created, the interval
77 value (or -1 if not applicable), the timestamp, the device name
78 (or - if not applicable), the field name and its value. Note
79 that timestamp output can be controlled by options -T, -t and
80 -U.
81
82 -s [ hh:mm:ss ]
83 Set the starting time of the data (given in local time), causing
84 the sadf command to extract records time-tagged at, or follow‐
85 ing, the time specified. The default starting time is 08:00:00.
86 Hours must be given in 24-hour format.
87
88 -T Display timestamp in local time instead of UTC (Coordinated Uni‐
89 versal Time).
90
91 -t Display timestamp in the original local time of the data file
92 creator instead of UTC (Coordinated Universal Time).
93
94 -U Display timestamp (UTC - Coordinated Universal Time) in seconds
95 from the epoch.
96
97 -V Print version number then exit.
98
99 -x Print the contents of the data file in XML format. Timestamps
100 can be controlled by options -T and -t. The corresponding DTD
101 (Document Type Definition) and XML Schema are included in the
102 sysstat source package. They are also available at http://pages‐
103 perso-orange.fr/sebastien.godard/download.html
104
105
107 The sadf command takes into account the following environment variable:
108
109
110 S_TIME_DEF_TIME
111 If this variable exists and its value is UTC then sadf will use
112 UTC time instead of local time to determine the current daily
113 data file located in the /var/log/sa directory.
114
116 sadf -d /var/log/sa/sa21 -- -r -n DEV
117 Extract memory, swap space and network statistics from system
118 activity file 'sa21', and display them in a format that can be
119 ingested by a database.
120
121 sadf -p -P 1
122 Extract CPU statistics for processor 1 (the second processor)
123 from current daily data file, and display them in a format that
124 can easily be handled by a pattern processing command.
125
126
128 /var/log/sa/sadd
129 Indicate the daily data file, where the dd parameter is a number
130 representing the day of the month.
131
132
134 Sebastien Godard (sysstat <at> orange.fr)
135
137 sar(1), sadc(8), sa1(8), sa2(8)
138
139 http://pagesperso-orange.fr/sebastien.godard/
140
141
142
143Linux JULY 2012 SADF(1)