Code

Merge branch 'upstream' into experimental
[pkg-rrdtool.git] / doc / rrdxport.txt
1 RRDXPORT(1)                         rrdtool                        RRDXPORT(1)
5 N\bNA\bAM\bME\bE
6        rrdxport - Export data in XML format based on data from one or several
7        RRD
9 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
10        r\brr\brd\bdt\bto\boo\bol\bl x\bxp\bpo\bor\brt\bt [-\b-s\bs|-\b--\b-s\bst\bta\bar\brt\bt _\bs_\be_\bc_\bo_\bn_\bd_\bs] [-\b-e\be|-\b--\b-e\ben\bnd\bd _\bs_\be_\bc_\bo_\bn_\bd_\bs]
11        [-\b-m\bm|-\b--\b-m\bma\bax\bxr\bro\bow\bws\bs _\br_\bo_\bw_\bs] [-\b--\b-s\bst\bte\bep\bp _\bv_\ba_\bl_\bu_\be] [D\bDE\bEF\bF:\b:_\bv_\bn_\ba_\bm_\be=\b=_\br_\br_\bd:\b:_\bd_\bs_\b-_\bn_\ba_\bm_\be:\b:_\bC_\bF]
12        [C\bCD\bDE\bEF\bF:\b:_\bv_\bn_\ba_\bm_\be=\b=_\br_\bp_\bn_\b-_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn] [X\bXP\bPO\bOR\bRT\bT:\b:_\bv_\bn_\ba_\bm_\be[:\b:_\bl_\be_\bg_\be_\bn_\bd]]
14 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
15        The x\bxp\bpo\bor\brt\bt function's main purpose is to write an XML formatted repre-
16        sentation of the data stored in one or several R\bRR\bRD\bDs. It can also
17        extract numerical reports.
19        If no _\bX_\bP_\bO_\bR_\bT statements are found, there will be no output.
21        -\b-s\bs|-\b--\b-s\bst\bta\bar\brt\bt _\bs_\be_\bc_\bo_\bn_\bd_\bs (default end-1day)
22            The time when the exported range should begin. Time in seconds
23            since epoch (1970-01-01) is required. Negative numbers are relative
24            to the current time. By default one day worth of data will be
25            printed.  See also AT-STYLE TIME SPECIFICATION section in the _\br_\br_\bd_\b-
26            _\bf_\be_\bt_\bc_\bh documentation for a detailed explanation on how to specify
27            time.
29        -\b-e\be|-\b--\b-e\ben\bnd\bd _\bs_\be_\bc_\bo_\bn_\bd_\bs (default now)
30            The time when the exported range should end. Time in seconds since
31            epoch.  See also AT-STYLE TIME SPECIFICATION section in the _\br_\br_\bd_\b-
32            _\bf_\be_\bt_\bc_\bh documentation for a detailed explanation of ways to specify
33            time.
35        -\b-m\bm|-\b--\b-m\bma\bax\bxr\bro\bow\bws\bs _\br_\bo_\bw_\bs (default 400 rows)
36            This works like the -\b-w\bw|-\b--\b-w\bwi\bid\bdt\bth\bh parameter of _\br_\br_\bd_\bg_\br_\ba_\bp_\bh.  In fact it
37            is exactly the same, but the parameter was renamed to describe its
38            purpose in this module. See _\br_\br_\bd_\bg_\br_\ba_\bp_\bh documentation for details.
40        -\b--\b-s\bst\bte\bep\bp _\bv_\ba_\bl_\bu_\be (default automatic)
41            See rrdgraph documentation.
43        -\b--\b-e\ben\bnu\bum\bmd\bds\bs
44            The generated xml should contain the data values in enumerated
45            tags.
47             <v0>val</v0><v1>val</v1>
49        D\bDE\bEF\bF:\b:_\bv_\bn_\ba_\bm_\be=\b=_\br_\br_\bd:\b:_\bd_\bs_\b-_\bn_\ba_\bm_\be:\b:_\bC_\bF
50            See _\br_\br_\bd_\bg_\br_\ba_\bp_\bh documentation.
52        C\bCD\bDE\bEF\bF:\b:_\bv_\bn_\ba_\bm_\be=\b=_\br_\bp_\bn_\b-_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
53            See _\br_\br_\bd_\bg_\br_\ba_\bp_\bh documentation.
55        X\bXP\bPO\bOR\bRT\bT:\b:_\bv_\bn_\ba_\bm_\be:\b::\b:_\bl_\be_\bg_\be_\bn_\bd
56            At least one _\bX_\bP_\bO_\bR_\bT statement should be present. The values refer-
57            enced by _\bv_\bn_\ba_\bm_\be are printed. Optionally add a legend.
59 O\bOu\but\btp\bpu\but\bt f\bfo\bor\brm\bma\bat\bt
60        The output is enclosed in an x\bxp\bpo\bor\brt\bt element and contains two blocks. The
61        first block is enclosed by a m\bme\bet\bta\ba element and contains some meta data.
62        The second block is enclosed by a d\bda\bat\bta\ba element and contains the data
63        rows.
65        Let's assume that the _\bx_\bp_\bo_\br_\bt command looks like this:
67          rrdtool xport \
68                  --start now-1h --end now \
69                  DEF:xx=host-inout.lo.rrd:output:AVERAGE \
70                  DEF:yy=host-inout.lo.rrd:input:AVERAGE \
71                  CDEF:aa=xx,yy,+,8,* \
72                  XPORT:xx:"out bytes" \
73                  XPORT:aa:"in and out bits"
75        The resulting meta data section is (the values will depend on the RRD
76        characteristics):
78          <meta>
79            <start>1020611700</start>
80            <step>300</step>
81            <end>1020615600</end>
82            <rows>14</rows>
83            <columns>2</columns>
84            <legend>
85              <entry>out bytes</entry>
86              <entry>in and out bits</entry>
87            </legend>
88          </meta>
90        The resulting data section is:
92          <data>
93            <row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
94            <row><t>1020612000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
95            <row><t>1020612300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
96            <row><t>1020612600</t><v>3.4113333333e+00</v><v>5.4581333333e+01</v></row>
97            <row><t>1020612900</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
98            <row><t>1020613200</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
99            <row><t>1020613500</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
100            <row><t>1020613800</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
101            <row><t>1020614100</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
102            <row><t>1020614400</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
103            <row><t>1020614700</t><v>3.7333333333e+00</v><v>5.9733333333e+01</v></row>
104            <row><t>1020615000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
105            <row><t>1020615300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
106            <row><t>1020615600</t><v>NaN</v><v>NaN</v></row>
107          </data>
109 E\bEX\bXA\bAM\bMP\bPL\bLE\bE 1\b1
110          rrdtool xport \
111                  DEF:out=if1-inouts.rrd:outoctets:AVERAGE \
112                  XPORT:out:"out bytes"
114 E\bEX\bXA\bAM\bMP\bPL\bLE\bE 2\b2
115          rrdtool xport \
116                  DEF:out1=if1-inouts.rrd:outoctets:AVERAGE \
117                  DEF:out2=if2-inouts.rrd:outoctets:AVERAGE \
118                  CDEF:sum=out1,out2,+ \
119                  XPORT:out1:"if1 out bytes" \
120                  XPORT:out2:"if2 out bytes" \
121                  XPORT:sum:"output sum"
123 A\bAU\bUT\bTH\bHO\bOR\bR
124        Tobias Oetiker <tobi@oetiker.ch>
128 1.3.5                             2008-03-15                       RRDXPORT(1)