NAME | SYNOPSIS | DESCRIPTION | CONFIGURATION FILE | COMMAND LINE OPTIONS | OUTPUT FORMAT | FILES | PCP ENVIRONMENT | SEE ALSO | COLOPHON

PCP2ELASTICSEARCH(1)       General Commands Manual      PCP2ELASTICSEARCH(1)

NAME         top

       pcp2elasticsearch - pcp-to-elasticsearch metrics exporter

SYNOPSIS         top

       pcp2elasticsearch [-CGHILrvV?]  [-a archive] [--archive-folio folio]
       [-A align] [-b space-scale] [-c config] [--container container]
       [--daemonize] [-e derived] [-g URL] [-h host] [-i instances] [-K
       spec] [-O origin] [-P precision] [-q count-scale] [-s samples] [-S
       starttime] [-t interval] [-T endtime] [-x index] [-X host-id] [-y
       time-scale] metricspec [...]

DESCRIPTION         top

       pcp2elasticsearch is a customizable performance metrics exporter tool
       from PCP to Elasticsearch.  Any available performance metric, live or
       archived, system and/or application, can be selected for exporting
       using either command line arguments or a configuration file.

       pcp2elasticsearch is a close relative of pmrep(1).  Please refer to
       pmrep(1) for the metricspec description accepted on pcp2elasticsearch
       command line and pmrep.conf(5) for description of the
       pcp2elasticsearch.conf configuration file overall syntax, this page
       describes pcp2elasticsearch specific options and configuration file
       differences with pmrep.conf(5).

       Only the command line options listed on this page are supported,
       other options recognized by pmrep(1) are not supported.

       Configuration file options override the corresponding built-in
       default values (if any).  Command line options override the
       corresponding configuration file options (if any).

CONFIGURATION FILE         top

       pcp2elasticsearch uses a configuration file with overall syntax
       described in pmrep.conf(5).  The following options are common with
       pmrep.conf: version, source, speclocal, derived, header, globals,
       samples, interval, type, ignore_incompat, instances, omit_flat,
       precision, count_scale, space_scale, time_scale.  The output option
       is recognized but ignored for pmrep.conf compatibility.

       pcp2elasticsearch specific options

       es_server (string)
           Specify the URL of Elasticsearch server to send the metrics to.
           Corresponding command line option is -g.  Default is
           http://localhost:9200/ .

       es_index (string)
           Specify the Elasticsearch index for metric names.  Corresponding
           command line option is -x.  Default is pcp.

       es_hostid (string)
           Specify the Elasticsearch host-id for measurements.
           Corresponding command line option is -X.  Defaults to the metrics
           source host.

COMMAND LINE OPTIONS         top

       The available command line options are:

       -a   Performance metric values are retrieved from the set of
            Performance Co-Pilot (PCP) archive log files identified by the
            argument archive, which is a comma-separated list of names, each
            of which may be the base name of an archive or the name of a
            directory containing one or more archives.

       --archive-folio
            Read metric source archives from the PCP archive folio (see
            mkaf(1)).

       -A   Force the initial sample to be aligned on the boundary of a
            natural time unit align.  Refer to PCPIntro(1) for a complete
            description of the syntax for align.

       -b   Unit/scale for space (byte) metrics, possible values include
            bytes, Kbytes, KB, Mbytes, MB, and so forth up to Ebytes, EB.
            This option will not override possible per-metric
            specifications.  See also pmParseUnitsStr(3).

       -c   Specify the config file to use.  The default is the first found
            of: ./pcp2elasticsearch.conf, $HOME/.pcp2elasticsearch.conf,
            $HOME/pcp/pcp2elasticsearch.conf, and
            $PCP_SYSCONF_DIR/pcp2elasticsearch.conf.  For details, see the
            above section and pmrep.conf(5).

       --container
            Fetch performance metrics from the specified container, either
            local or remote (see -h).

       -C   Exit before reporting any values, but after parsing the
            configuration and metrics and printing possible headers.

       --daemonize
            Daemonize on startup.

       -e   Specify derived performance metrics. If derived starts with a
            slash (``/'') or with a dot (``.'') it will be interpreted as a
            derived metrics configuration file, otherwise it will be
            interpreted as comma-separated derived metric expressions.  For
            details see pmLoadDerivedConfig(3) and pmRegisterDerived(3).

       -g   Elasticsearch server URL to send the metrics to.

       -G   Do not include global metrics in reporting (see pmrep.conf(5)).

       -h   Fetch performance metrics from pmcd(1) on host, rather than the
            default localhost.

       -H   Do not print any headers.

       -i   Report only the listed instances (if present).  By default all
            current instances are reported.  This is a global option that is
            used for all metrics unless a metric-specific instance
            definition is provided as part of a metricspec.  By default
            metrics without instances are reported as usual, use -v to
            change this.  Please refer to pmrep(1) for more details on this
            option.

       -I   Ignore incompatible metrics. By default incompatible metrics
            (that is, their type is unsupported or they cannot be scaled as
            requested) will cause pcp2elasticsearch to terminate with an
            error message.  With this option all incompatible metrics are
            silently omitted from reporting. This may be especially useful
            when requesting non-leaf nodes of the PMNS tree for reporting.

       -K   When fetching metrics from a local context (see -L), the -K
            option may be used to control the DSO PMDAs that should be made
            accessible.  The spec argument conforms to the syntax described
            in __pmSpecLocalPMDA(3).  More than one -K option may be used.

       -L   Use a local context to collect metrics from DSO PMDAs on the
            local host without PMCD.  See also -K.

       -O   When reporting archived metrics, start reporting at origin
            within the time window (see -S and -T).  Refer to PCPIntro(1)
            for a complete description of the syntax for origin.

       -P   Use precision for numeric non-integer output values.  The
            default is to use 3 decimal places (when applicable).

       -q   Unit/scale for count metrics, possible values include count x
            10^-1, count, count x 10, count x 10^2, and so forth from 10^-8
            to 10^7.  (These values are currently space-sensitive.)  This
            option will not override possible per-metric specifications.
            See also pmParseUnitsStr(3).

       -r   Output raw metric values, do not convert cumulative counters to
            rates.  This option will override possible per-metric
            specifications.

       -s   The argument samples defines the number of samples to be
            retrieved and reported.  If samples is 0 or -s is not specified,
            pcp2elasticsearch will sample and report continuously (in real
            time mode) or until the end of the set of PCP archives (in
            archive mode).  See also -T.

       -S   When reporting archived metrics, the report will be restricted
            to those records logged at or after starttime.  Refer to
            PCPIntro(1) for a complete description of the syntax for
            starttime.

       -t   The default update interval may be set to something other than
            the default 1 second.  The interval argument follows the syntax
            described in PCPIntro(1), and in the simplest form may be an
            unsigned integer (the implied units in this case are seconds).
            See also the -T option.

       -T   When reporting archived metrics, the report will be restricted
            to those records logged before or at endtime.  Refer to
            PCPIntro(1) for a complete description of the syntax for
            endtime.

            When used to define the runtime before pcp2elasticsearch will
            exit, if no samples is given (see -s) then the number of
            reported samples depends on interval (see -t).  If samples is
            given then interval will be adjusted to allow reporting of
            samples during runtime.  In case all of -T, -s, and -t are
            given, endtime determines the actual time pcp2elasticsearch will
            run.

       -v   Omit single-valued ``flat'' metrics from reporting when
            instances were requested.  See -i and -I.

       -V   Display version number and exit.

       -x   Elasticsearch index for metric names.

       -X   Elasticsearch host-id for measurements.

       -y   Unit/scale for time metrics, possible values include nanosec,
            ns, microsec, us, millisec, ms, and so forth up to hour, hr.
            This option will not override possible per-metric
            specifications.  See also pmParseUnitsStr(3).

       -?   Display usage message and exit.

OUTPUT FORMAT         top

       First, pcp2elasticsearch sends this type definition to Elasticsearch:

               {
                   "mappings": {
                       "pcp-metric": {
                           "properties": {
                               "@timestamp": {
                                   "type": "date"
                               },
                               "host-id": {
                                   "type": "string"
                               }
                           }
                       }
                   }
               }

       The actual metrics data document is similar to this example:

               {
                   "@host-id": "bozo",
                   "mem": {
                       "util": {
                           "used": 4525820,
                           "free": 3344000
                       }
                   },
                   "@timestamp": 1507637520,
                   "disk": {
                       "partitions": {
                           "@instances": [
                               {
                                   "read": 1121,
                                   "@id": "sda1"
                               },
                               {
                                   "read": 77306,
                                   "@id": "sda2"
                               },
                               {
                                   "read": 131,
                                   "@id": "sda3"
                               }
                           ]
                       }
                   }
               }

FILES         top

       pcp2elasticsearch.conf
                 pcp2elasticsearch configuration file (see -c).

PCP ENVIRONMENT         top

       Environment variables with the prefix PCP_ are used to parametrize
       the file and directory names used by PCP.  On each installation, the
       file /etc/pcp.conf contains the local values for these variables.
       The $PCP_CONF variable may be used to specify an alternative
       configuration file, as described in pcp.conf(5).

SEE ALSO         top

       mkaf(1), PCPIntro(1), pcp(1), pcp2graphite(1), pcp2influxdb(1),
       pcp2json(1), pcp2xlsx(1), pcp2xml(1), pcp2zabbix(1), pmcd(1),
       pminfo(1), pmrep(1), __pmSpecLocalPMDA(3), pmLoadDerivedConfig(3),
       pmParseUnitsStr(3), pmRegisterDerived(3), pcp.conf(5), pmlogger(5),
       pmns(5) and pmrep.conf(5).

COLOPHON         top

       This page is part of the PCP (Performance Co-Pilot) project.
       Information about the project can be found at ⟨http://www.pcp.io/⟩.
       If you have a bug report for this manual page, send it to
       pcp@groups.io.  This page was obtained from the project's upstream
       Git repository ⟨https://github.com/performancecopilot/pcp.git⟩ on
       2017-11-25.  (At that time, the date of the most recent commit that
       was found in the repository was 2017-11-24.)  If you discover any
       rendering problems in this HTML version of the page, or you believe
       there is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       man-pages@man7.org

Performance Co-Pilot                 PCP                PCP2ELASTICSEARCH(1)

Pages that refer to this page: pcp2graphite(1)pcp2influxdb(1)pcp2json(1)pcp2xlsx(1)pcp2xml(1)pcp2zabbix(1)pmrep(1)