docs: refresh & structure overhaul
[nfvbench.git] / docs / user / kibana.rst
1 .. Copyright 2016 - 2023, Cisco Systems, Inc. and the NFVbench project contributors
2 .. SPDX-License-Identifier: CC-BY-4.0
3
4 NFVbench Kibana visualization: overview
5 =======================================
6
7 The fluentd integration offers the possibility to use elasticsearch and kibana as a visualization chain.
8
9 Chain overview:
10
11 .. image:: images/nfvbench-kibana.png
12
13 Example of NFVbench visualizations
14 ----------------------------------
15
16 Kibana offers a lot of visualization type (line and bar charts, pie, time series chart, data table ...) and also provide a plugin to develop graph using Vega.
17 In the below examples, visualizations are based on an NDR result and are developed using `Vega-lite <https://vega.github.io/vega-lite-v2>`_.
18 Data are aggregated using ``user_label`` and ``flow_count`` properties.
19
20 In ``kibana/visualizations/`` pre-created graphs are available into json files.
21
22 For NDR capacity in Gbps using line chart, the offered load in Gbps (``offered_tx_rate_bps``) is used and only the maximum value of the aggregation is kept.
23 For NDR capacity in Mpps using line chart, the actual TX rate is used (``rate_pps``) and only the maximum value of the aggregation is kept.
24
25 Scatter plot graphs use the same values but keep all values instead of keeping maximum.
26
27 Example of a line chart:
28
29 .. image:: images/nfvbench-kibana-gbps-line.png
30
31 Example of a scatter plot chart:
32
33 .. image:: images/nfvbench-kibana-pps-scatter.png
34
35 Vega offers the possibility to add another graph as a new layer of current graph.
36 This solution is used to combine NFVbench results and theoretical line rate.
37 Using ``extra_encapsulation_bytes`` in --user-info property (see :ref:`user-info`),
38 the theoretical max value (for bps and pps) will be calculated and can be used in graph through ``theoretical_tx_rate_bps`` and ``theoretical_tx_rate_pps`` properties.
39
40 Example of chart with theoretical value (red line):
41
42 .. image:: images/nfvbench-kibana-pps-theoretical.png
43
44 Each Vega graph can be moved, zoomed (using mouse scroll) and one set of data can be selected.
45
46 Example:
47
48 .. image:: images/nfvbench-kibana-zoom-selection.png
49
50 These visualizations are included into Kibana dashboard for a synthesis of one set of result (i.e. same ``user_label`` value) or for comparison (i.e. a selection of ``user_label`` values).
51 See :ref:`filterkibana` for more details about ``user_label`` selection.
52
53 All these visualizations and dashboards are saved into the ``export.ndjson`` file and can be imported in an existing Kibana. See :ref:`importkibana`.
54
55 .. _importkibana:
56
57 Import Kibana dashboards and visualization
58 ------------------------------------------
59
60 To import Kibana dashboard and visualization:
61
62 .. code-block:: bash
63
64     curl -X POST localhost:5601/api/saved_objects/_import -H "kbn-xsrf: true" --form file=@export.ndjson
65
66 .. note:: ``.kibana`` index must exists in elasticsearch.
67 .. note:: ``.kibana`` index is created automatically after a first deployment and configuration of Kibana.
68
69 .. _filterkibana:
70
71 Kibana user guide: Filter dashboards and visualizations
72 =======================================================
73
74 Filter Kibana dashboard or visualization using Kibana query language (KQL)
75 --------------------------------------------------------------------------
76
77 .. code-block:: bash
78
79     user_label:*demo* and (flow_count: 128 or flow_count:130000 or flow_count:1000000)
80
81 .. note:: This query will filter all user label which contains ``demo`` in the value and filter 3 flow count (128, 130k, 1M).
82 .. note:: ``flow_count`` is a number so KQL query can not contain formatted string.
83
84 Example:
85
86 .. image:: images/nfvbench-kibana-filter-kql.png
87
88
89 Filter Kibana dashboard or visualization using Kibana filters
90 -------------------------------------------------------------
91
92 Kibana offers the possibility to add filter by selecting field and operator (is, is not, is one of, is not one of, exists, does not exist).
93
94 Example:
95
96 .. image:: images/nfvbench-kibana-filter.png