File: elastic.rst

package info (click to toggle)
glances 3.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,944 kB
  • sloc: javascript: 26,103; python: 11,238; makefile: 229; sh: 169
file content (42 lines) | stat: -rw-r--r-- 927 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.. _elastic:

Elasticsearch
=============
.. note::
    You need to install the `elasticsearch`_ library on your system.

You can export statistics to an ``Elasticsearch`` server. The connection
should be defined in the Glances configuration file as following:

.. code-block:: ini

    [elasticsearch]
    host=localhost
    port=9200
    index=glances

and run Glances with:

.. code-block:: console

    $ glances --export elasticsearch

The stats are available through the elasticsearch API. For example, to
get the CPU system stats:

.. code-block:: console

    $ curl http://172.17.0.2:9200/glances/cpu/system
    {
        "_index": "glances",
        "_type": "cpu",
        "_id": "system",
        "_version": 28,
        "found": true,"
        _source": {
            "timestamp": "2016-02-04T14:11:02.362232",
            "value": "2.2"
        }
    }

.. _elasticsearch: https://pypi.org/project/elasticsearch/