1RRDXPORT(1)                         rrdtool                        RRDXPORT(1)
2
3
4

NAME

6       rrdxport - Export data in XML format based on data from one or several
7       RRD
8

SYNOPSIS

10       rrdtool xport [-s|--start seconds] [-e|--end seconds]
11       [-m|--maxrows rows] [--step value] [--json] [-t|--showtime] [--enumds]
12       [--daemon|-d address] [DEF:vname=rrd:ds-name:CF] [CDEF:vname=rpn-
13       expression] [XPORT:vname[:legend]]
14

DESCRIPTION

16       The xport function's main purpose is to write an XML formatted
17       representation of the data stored in one or several RRDs. It can also
18       extract numerical reports.
19
20       If no XPORT statements are found, there will be no output.
21
22       -s|--start seconds (default end-1day)
23           The time when the exported range should begin. Time in seconds
24           since epoch (1970-01-01) is required. Negative numbers are relative
25           to the current time. By default one day worth of data will be
26           printed.  See also AT-STYLE TIME SPECIFICATION section in the
27           rrdfetch documentation for a detailed explanation on how to specify
28           time.
29
30       -e|--end seconds (default now)
31           The time when the exported range should end. Time in seconds since
32           epoch.  See also AT-STYLE TIME SPECIFICATION section in the
33           rrdfetch documentation for a detailed explanation of ways to
34           specify time.
35
36       -m|--maxrows rows (default 400 rows)
37           This works like the -w|--width parameter of rrdgraph.  In fact it
38           is exactly the same, but the parameter was renamed to describe its
39           purpose in this module. See rrdgraph documentation for details.
40
41       --step value (default automatic)
42           See rrdgraph documentation.
43
44       --daemon|-d address
45           Address of the rrdcached daemon. If specified, a "flush" command is
46           sent to the server before reading the RRD files. This allows
47           rrdtool to return fresh data even if the daemon is configured to
48           cache values for a long time.  For a list of accepted formats, see
49           the -l option in the rrdcached manual.
50
51             rrdtool xport --daemon unix:/var/run/rrdcached.sock ...
52
53       -t|--showtime
54           include the time into each data row.
55
56       --json
57           produce json formatted output (instead of xml)
58
59       --enumds
60           The generated xml should contain the data values in enumerated
61           tags.
62
63            <v0>val</v0><v1>val</v1>
64
65       DEF:vname=rrd:ds-name:CF
66           See rrdgraph documentation.
67
68       CDEF:vname=rpn-expression
69           See rrdgraph documentation.
70
71       XPORT:vname[:legend]
72           At least one XPORT statement should be present. The values
73           referenced by vname are printed. Optionally add a legend.
74

Output format

76       The output is enclosed in an xport element and contains two blocks. The
77       first block is enclosed by a meta element and contains some meta data.
78       The second block is enclosed by a data element and contains the data
79       rows.
80
81       Let's assume that the xport command looks like this:
82
83         rrdtool xport \
84                 --start now-1h --end now \
85                 DEF:xx=host-inout.lo.rrd:output:AVERAGE \
86                 DEF:yy=host-inout.lo.rrd:input:AVERAGE \
87                 CDEF:aa=xx,yy,+,8,* \
88                 XPORT:xx:"out bytes" \
89                 XPORT:aa:"in and out bits"
90
91       The resulting meta data section is (the values will depend on the RRD
92       characteristics):
93
94         <meta>
95           <start>1020611700</start>
96           <step>300</step>
97           <end>1020615600</end>
98           <rows>14</rows>
99           <columns>2</columns>
100           <legend>
101             <entry>out bytes</entry>
102             <entry>in and out bits</entry>
103           </legend>
104         </meta>
105
106       The resulting data section is:
107
108         <data>
109           <row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
110           <row><t>1020612000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
111           <row><t>1020612300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
112           <row><t>1020612600</t><v>3.4113333333e+00</v><v>5.4581333333e+01</v></row>
113           <row><t>1020612900</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
114           <row><t>1020613200</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
115           <row><t>1020613500</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
116           <row><t>1020613800</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
117           <row><t>1020614100</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
118           <row><t>1020614400</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
119           <row><t>1020614700</t><v>3.7333333333e+00</v><v>5.9733333333e+01</v></row>
120           <row><t>1020615000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
121           <row><t>1020615300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
122           <row><t>1020615600</t><v>NaN</v><v>NaN</v></row>
123         </data>
124

EXAMPLE 1

126         rrdtool xport \
127                 DEF:out=if1-inouts.rrd:outoctets:AVERAGE \
128                 XPORT:out:"out bytes"
129

EXAMPLE 2

131         rrdtool xport \
132                 DEF:out1=if1-inouts.rrd:outoctets:AVERAGE \
133                 DEF:out2=if2-inouts.rrd:outoctets:AVERAGE \
134                 CDEF:sum=out1,out2,+ \
135                 XPORT:out1:"if1 out bytes" \
136                 XPORT:out2:"if2 out bytes" \
137                 XPORT:sum:"output sum"
138

ENVIRONMENT VARIABLES

140       The following environment variables may be used to change the behavior
141       of "rrdtool xport":
142
143       RRDCACHED_ADDRESS
144           If this environment variable is set it will have the same effect as
145           specifying the "--daemon" option on the command line. If both are
146           present, the command line argument takes precedence.
147

AUTHOR

149       Tobias Oetiker <tobi@oetiker.ch>
150
151
152
1531.5.999                           2016-05-23                       RRDXPORT(1)
Impressum