Code

Imported upstream version 1.4.8
[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] [-\b--\b-j\bjs\bso\bon\bn] [-\b--\b-d\bda\bae\bem\bmo\bon\bn _\ba_\bd_\bd_\br_\be_\bs_\bs]
12        [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] [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]
13        [X\bXP\bPO\bOR\bRT\bT:\b:_\bv_\bn_\ba_\bm_\be[:\b:_\bl_\be_\bg_\be_\bn_\bd]]
15 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
16        The x\bxp\bpo\bor\brt\bt function's main purpose is to write an XML formatted
17        representation of the data stored in one or several R\bRR\bRD\bDs. It can also
18        extract numerical reports.
20        If no _\bX_\bP_\bO_\bR_\bT statements are found, there will be no output.
22        -\b-s\bs|-\b--\b-s\bst\bta\bar\brt\bt _\bs_\be_\bc_\bo_\bn_\bd_\bs (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            _\br_\br_\bd_\bf_\be_\bt_\bc_\bh documentation for a detailed explanation on how to specify
28            time.
30        -\b-e\be|-\b--\b-e\ben\bnd\bd _\bs_\be_\bc_\bo_\bn_\bd_\bs (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            _\br_\br_\bd_\bf_\be_\bt_\bc_\bh documentation for a detailed explanation of ways to
34            specify time.
36        -\b-m\bm|-\b--\b-m\bma\bax\bxr\bro\bow\bws\bs _\br_\bo_\bw_\bs (default 400 rows)
37            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
38            is exactly the same, but the parameter was renamed to describe its
39            purpose in this module. See _\br_\br_\bd_\bg_\br_\ba_\bp_\bh documentation for details.
41        -\b--\b-s\bst\bte\bep\bp _\bv_\ba_\bl_\bu_\be (default automatic)
42            See rrdgraph documentation.
44        -\b--\b-d\bda\bae\bem\bmo\bon\bn _\ba_\bd_\bd_\br_\be_\bs_\bs
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            r\brr\brd\bdt\bto\boo\bol\bl 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 -\b-l\bl option in the rrdcached manual.
51              rrdtool xport --daemon unix:/var/run/rrdcached.sock ...
53        -\b--\b-j\bjs\bso\bon\bn
54            produce json formated output (instead of xml)
56        -\b--\b-e\ben\bnu\bum\bmd\bds\bs
57            The generated xml should contain the data values in enumerated
58            tags.
60             <v0>val</v0><v1>val</v1>
62        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
63            See _\br_\br_\bd_\bg_\br_\ba_\bp_\bh documentation.
65        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
66            See _\br_\br_\bd_\bg_\br_\ba_\bp_\bh documentation.
68        X\bXP\bPO\bOR\bRT\bT:\b:_\bv_\bn_\ba_\bm_\be:\b::\b:_\bl_\be_\bg_\be_\bn_\bd
69            At least one _\bX_\bP_\bO_\bR_\bT statement should be present. The values
70            referenced by _\bv_\bn_\ba_\bm_\be are printed. Optionally add a legend.
72 O\bOu\but\btp\bpu\but\bt f\bfo\bor\brm\bma\bat\bt
73        The output is enclosed in an x\bxp\bpo\bor\brt\bt element and contains two blocks. The
74        first block is enclosed by a m\bme\bet\bta\ba element and contains some meta data.
75        The second block is enclosed by a d\bda\bat\bta\ba element and contains the data
76        rows.
78        Let's assume that the _\bx_\bp_\bo_\br_\bt command looks like this:
80          rrdtool xport \
81                  --start now-1h --end now \
82                  DEF:xx=host-inout.lo.rrd:output:AVERAGE \
83                  DEF:yy=host-inout.lo.rrd:input:AVERAGE \
84                  CDEF:aa=xx,yy,+,8,* \
85                  XPORT:xx:"out bytes" \
86                  XPORT:aa:"in and out bits"
88        The resulting meta data section is (the values will depend on the RRD
89        characteristics):
91          <meta>
92            <start>1020611700</start>
93            <step>300</step>
94            <end>1020615600</end>
95            <rows>14</rows>
96            <columns>2</columns>
97            <legend>
98              <entry>out bytes</entry>
99              <entry>in and out bits</entry>
100            </legend>
101          </meta>
103        The resulting data section is:
105          <data>
106            <row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
107            <row><t>1020612000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
108            <row><t>1020612300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
109            <row><t>1020612600</t><v>3.4113333333e+00</v><v>5.4581333333e+01</v></row>
110            <row><t>1020612900</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
111            <row><t>1020613200</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
112            <row><t>1020613500</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
113            <row><t>1020613800</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
114            <row><t>1020614100</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
115            <row><t>1020614400</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
116            <row><t>1020614700</t><v>3.7333333333e+00</v><v>5.9733333333e+01</v></row>
117            <row><t>1020615000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
118            <row><t>1020615300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
119            <row><t>1020615600</t><v>NaN</v><v>NaN</v></row>
120          </data>
122 E\bEX\bXA\bAM\bMP\bPL\bLE\bE 1\b1
123          rrdtool xport \
124                  DEF:out=if1-inouts.rrd:outoctets:AVERAGE \
125                  XPORT:out:"out bytes"
127 E\bEX\bXA\bAM\bMP\bPL\bLE\bE 2\b2
128          rrdtool xport \
129                  DEF:out1=if1-inouts.rrd:outoctets:AVERAGE \
130                  DEF:out2=if2-inouts.rrd:outoctets:AVERAGE \
131                  CDEF:sum=out1,out2,+ \
132                  XPORT:out1:"if1 out bytes" \
133                  XPORT:out2:"if2 out bytes" \
134                  XPORT:sum:"output sum"
136 E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bES\bS
137        The following environment variables may be used to change the behavior
138        of "rrdtool xport":
140        R\bRR\bRD\bDC\bCA\bAC\bCH\bHE\bED\bD_\b_A\bAD\bDD\bDR\bRE\bES\bSS\bS
141            If this environment variable is set it will have the same effect as
142            specifying the "--daemon" option on the command line. If both are
143            present, the command line argument takes precedence.
145 A\bAU\bUT\bTH\bHO\bOR\bR
146        Tobias Oetiker <tobi@oetiker.ch>
150 1.4.8                             2013-05-23                       RRDXPORT(1)