{
    "content": [
        {
            "type": "text",
            "text": "# rrdxport (man)\n\n## NAME\n\nrrdxport - Export data in XML format based on data from one or several RRD\n\n## SYNOPSIS\n\nrrdtool xport [-s|--start seconds] [-e|--end seconds] [-m|--maxrows rows] [--step value]\n[--json] [-t|--showtime] [--enumds] [--daemon|-d address] [DEF:vname=rrd:ds-name:CF]\n[CDEF:vname=rpn-expression] [XPORT:vname[:legend]]\n\n## DESCRIPTION\n\nThe xport function's main purpose is to write an XML formatted representation of the data\nstored in one or several RRDs. It can also extract numerical reports.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (6 subsections)\n- **OUTPUT FORMAT**\n- **EXAMPLE 1**\n- **EXAMPLE 2**\n- **ENVIRONMENT VARIABLES**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "rrdxport",
        "section": "",
        "mode": "man",
        "summary": "rrdxport - Export data in XML format based on data from one or several RRD",
        "synopsis": "rrdtool xport [-s|--start seconds] [-e|--end seconds] [-m|--maxrows rows] [--step value]\n[--json] [-t|--showtime] [--enumds] [--daemon|-d address] [DEF:vname=rrd:ds-name:CF]\n[CDEF:vname=rpn-expression] [XPORT:vname[:legend]]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-s",
                "long": "--start",
                "arg": null,
                "description": "The time when the exported range should begin. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be printed. See also \"AT-STYLE TIME SPECIFICATION\" in rrdfetch for a detailed explanation on how to specify time. See \"OUTPUT FORMAT\" below for details on how this affects the output."
            },
            {
                "flag": "-e",
                "long": "--end",
                "arg": null,
                "description": "The time when the exported range should end. Time in seconds since epoch. See also \"AT- STYLE TIME SPECIFICATION\" in rrdfetch for a detailed explanation on how to specify time. See \"OUTPUT FORMAT\" below for details on how this affects the output."
            },
            {
                "flag": "-m",
                "long": "--maxrows",
                "arg": null,
                "description": "This works like the -w|--width parameter of rrdgraph. In fact it is exactly the same, but the parameter was renamed to describe its purpose in this module. See rrdgraph documentation for details. --step value (default automatic) See rrdgraph documentation. --daemon|-d address Address of the rrdcached daemon. If specified, a \"flush\" command is sent to the server before reading the RRD files. This allows rrdtool to return fresh data even if the daemon is configured to cache values for a long time. For a list of accepted formats, see the -l option in the rrdcached manual. rrdtool xport --daemon unix:/var/run/rrdcached.sock ..."
            },
            {
                "flag": "-t",
                "long": "--showtime",
                "arg": null,
                "description": "include the time into each data row."
            },
            {
                "flag": "",
                "long": "--json",
                "arg": null,
                "description": "produce json formatted output (instead of xml)"
            },
            {
                "flag": "",
                "long": "--enumds",
                "arg": null,
                "description": "The generated xml should contain the data values in enumerated tags. <v0>val</v0><v1>val</v1> DEF:vname=rrd:ds-name:CF See rrdgraph documentation. CDEF:vname=rpn-expression See rrdgraph documentation. XPORT:vname[:legend] At least one XPORT statement should be present. The values referenced by vname are printed. Optionally add a legend."
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": [
                    {
                        "name": "-s --start _",
                        "lines": 7,
                        "flag": "-s",
                        "long": "--start"
                    },
                    {
                        "name": "-e --end _",
                        "lines": 5,
                        "flag": "-e",
                        "long": "--end"
                    },
                    {
                        "name": "-m --maxrows _",
                        "lines": 15,
                        "flag": "-m",
                        "long": "--maxrows"
                    },
                    {
                        "name": "-t --showtime",
                        "lines": 2,
                        "flag": "-t",
                        "long": "--showtime"
                    },
                    {
                        "name": "--json",
                        "lines": 2,
                        "long": "--json"
                    },
                    {
                        "name": "--enumds",
                        "lines": 14,
                        "long": "--enumds"
                    }
                ]
            },
            {
                "name": "OUTPUT FORMAT",
                "lines": 73,
                "subsections": []
            },
            {
                "name": "EXAMPLE 1",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "EXAMPLE 2",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT VARIABLES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "rrdxport - Export data in XML format based on data from one or several RRD\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "rrdtool xport [-s|--start seconds] [-e|--end seconds] [-m|--maxrows rows] [--step value]\n[--json] [-t|--showtime] [--enumds] [--daemon|-d address] [DEF:vname=rrd:ds-name:CF]\n[CDEF:vname=rpn-expression] [XPORT:vname[:legend]]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The xport function's main purpose is to write an XML formatted representation of the data\nstored in one or several RRDs. It can also extract numerical reports.\n\nIf no XPORT statements are found, there will be no output.\n",
                "subsections": [
                    {
                        "name": "-s --start _",
                        "content": "The  time  when the exported range should begin. Time in seconds since epoch (1970-01-01)\nis required. Negative numbers are relative to the current time. By default one day  worth\nof  data  will  be  printed.   See  also  \"AT-STYLE TIME SPECIFICATION\" in rrdfetch for a\ndetailed explanation on how to specify time.\n\nSee \"OUTPUT FORMAT\" below for details on how this affects the output.\n",
                        "flag": "-s",
                        "long": "--start"
                    },
                    {
                        "name": "-e --end _",
                        "content": "The time when the exported range should end. Time in seconds since epoch.  See also  \"AT-\nSTYLE TIME SPECIFICATION\" in rrdfetch for a detailed explanation on how to specify time.\n\nSee \"OUTPUT FORMAT\" below for details on how this affects the output.\n",
                        "flag": "-e",
                        "long": "--end"
                    },
                    {
                        "name": "-m --maxrows _",
                        "content": "This  works  like  the -w|--width parameter of rrdgraph.  In fact it is exactly the same,\nbut the parameter was renamed to describe  its  purpose  in  this  module.  See  rrdgraph\ndocumentation for details.\n\n--step value (default automatic)\nSee rrdgraph documentation.\n\n--daemon|-d address\nAddress  of  the  rrdcached daemon. If specified, a \"flush\" command is sent to the server\nbefore reading the RRD files. This allows rrdtool to return fresh data even if the daemon\nis configured to cache values for a long time.  For a list of accepted formats,  see  the\n-l option in the rrdcached manual.\n\nrrdtool xport --daemon unix:/var/run/rrdcached.sock ...\n",
                        "flag": "-m",
                        "long": "--maxrows"
                    },
                    {
                        "name": "-t --showtime",
                        "content": "include the time into each data row.\n",
                        "flag": "-t",
                        "long": "--showtime"
                    },
                    {
                        "name": "--json",
                        "content": "produce json formatted output (instead of xml)\n",
                        "long": "--json"
                    },
                    {
                        "name": "--enumds",
                        "content": "The generated xml should contain the data values in enumerated tags.\n\n<v0>val</v0><v1>val</v1>\n\nDEF:vname=rrd:ds-name:CF\nSee rrdgraph documentation.\n\nCDEF:vname=rpn-expression\nSee rrdgraph documentation.\n\nXPORT:vname[:legend]\nAt  least  one  XPORT  statement  should  be  present. The values referenced by vname are\nprinted. Optionally add a legend.\n",
                        "long": "--enumds"
                    }
                ]
            },
            "OUTPUT FORMAT": {
                "content": "The output is enclosed in an xport element and  contains  two  blocks.  The  first  block  is\nenclosed  by  a  meta  element and contains some meta data. The second block is enclosed by a\ndata element and contains the data rows.\n\nLet's assume that the xport command looks like this:\n\nrrdtool xport \\\n--start now-1h --end now \\\nDEF:xx=host-inout.lo.rrd:output:AVERAGE \\\nDEF:yy=host-inout.lo.rrd:input:AVERAGE \\\nCDEF:aa=xx,yy,+,8,* \\\nXPORT:xx:\"out bytes\" \\\nXPORT:aa:\"in and out bits\"\n\nThe resulting meta data section is (the values will depend on the RRD characteristics):\n\n<meta>\n<start>1020611700</start>\n<step>300</step>\n<end>1020615600</end>\n<rows>14</rows>\n<columns>2</columns>\n<legend>\n<entry>out bytes</entry>\n<entry>in and out bits</entry>\n</legend>\n</meta>\n\nThe resulting data section is:\n\n<data>\n<row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020612000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020612300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020612600</t><v>3.4113333333e+00</v><v>5.4581333333e+01</v></row>\n<row><t>1020612900</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020613200</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020613500</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020613800</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020614100</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020614400</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020614700</t><v>3.7333333333e+00</v><v>5.9733333333e+01</v></row>\n<row><t>1020615000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020615300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n<row><t>1020615600</t><v>NaN</v><v>NaN</v></row>\n</data>\n\nAll the statistics in the output will use the same step. The first sample will be  the  first\nsample  starting  immediately  after  --start.  The  last sample will be the one ending at or\nimmediately after --end.\n\nEach sample has a timestamp and one or more values. The timestamps associated with a value in\nRRDtool ALWAYS represent the time the sample was taken.  Since  any  value  you  sample  will\nrepresent  some  sort  of past state your sampling apparatus has gathered, the timestamp will\nalways be at the end of the sampling period.\n\nRRDtool does not store the actual  samples,  but  does  internal  resampling  of  the  values\npresented  to  it.  Nevertheless  when  a data value is presented with a single timestamp the\ntimestamp is at the end of the period the value represents. Note that the timestamp itself is\noutside the period the sample is valid for. For more details about this, see PDP  calculation\nexplanation.\n\nSo the time range for a sample with a timestamp is actually from \"timestamp - step\" inclusive\nto \"timestamp\" exclusive.\n\nThe first line of the sample output:\n\n<row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>\n\ntherefore  means  that the values for the interval 1020611400 to 1020611699 were 3.4 and 54.4\nfor \"out bytes\" and  \"in  and  out  bits\"  respectively,  because  the  value  was  taken  at\n1020611700.\n",
                "subsections": []
            },
            "EXAMPLE 1": {
                "content": "rrdtool xport \\\nDEF:out=if1-inouts.rrd:outoctets:AVERAGE \\\nXPORT:out:\"out bytes\"\n",
                "subsections": []
            },
            "EXAMPLE 2": {
                "content": "rrdtool xport \\\nDEF:out1=if1-inouts.rrd:outoctets:AVERAGE \\\nDEF:out2=if2-inouts.rrd:outoctets:AVERAGE \\\nCDEF:sum=out1,out2,+ \\\nXPORT:out1:\"if1 out bytes\" \\\nXPORT:out2:\"if2 out bytes\" \\\nXPORT:sum:\"output sum\"\n",
                "subsections": []
            },
            "ENVIRONMENT VARIABLES": {
                "content": "The following environment variables may be used to change the behavior of \"rrdtool xport\":\n\nRRDCACHEDADDRESS\nIf  this  environment  variable  is  set  it  will have the same effect as specifying the\n\"--daemon\" option on the command line. If both are present,  the  command  line  argument\ntakes precedence.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Tobias Oetiker <tobi@oetiker.ch>\n\n1.7.2                                        2024-03-31                                  RRDXPORT(1)",
                "subsections": []
            }
        }
    }
}