NFVBENCH-41 Add fluentd result tag to nfvbench server
[nfvbench.git] / docs / testing / user / userguide / fluentd.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. (c) Cisco Systems, Inc
4
5 NFVbench Fluentd Integration
6 ============================================
7
8 NFVbench has an optional fluentd integration to save logs and results.
9
10 Configuring Fluentd to receive NFVbench logs and results
11 --------------------------------------------------------
12
13 The following configurations should be added to Fluentd configuration file to enable logs or results.
14
15 To receive logs, and forward to a storage server:
16
17 In the example below nfvbench is the tag name for logs (which should be matched with logging_tag
18 under NFVbench configuration), and storage backend is elasticsearch which is
19 running at localhost:9200.
20
21
22 .. code-block:: bash
23     <match nfvbench.**>
24     @type copy
25     <store>
26         @type elasticsearch
27         host localhost
28         port 9200
29         logstash_format true
30         logstash_prefix nfvbench
31         utc_index false
32         flush_interval 15s
33     </store>
34     </match>
35
36 To receive results, and forward to a storage server:
37
38 In the example below resultnfvbench is the tag name for results (which should be matched with result_tag
39 under NFVbench configuration), and storage backend is elasticsearch which is
40 running at localhost:9200.
41
42 .. code-block:: bash
43     <match resultnfvbench.**>
44     @type copy
45     <store>
46         @type elasticsearch
47         host localhost
48         port 9200
49         logstash_format true
50         logstash_prefix resultnfvbench
51         utc_index false
52         flush_interval 15s
53     </store>
54     </match>
55
56 Configuring NFVbench to connect Fluentd
57 ---------------------------------------
58
59 To configure NFVbench to connect Fluentd, fill following configuration parameters in the
60 configuration file
61
62 +------------------------------------------------------+------------------------------------------------------+
63 | Configuration                                        | Description                                          |
64 +======================================================+======================================================+
65 | logging_tag                                          | Tag for NFVbench logs, it should be the same tag     |
66 |                                                      | defined in Fluentd configuration                     |
67 +------------------------------------------------------+------------------------------------------------------+
68 | result_tag                                           | Tag for NFVbench results, it should be the same tag  |
69 |                                                      | defined in Fluentd configuration                     |
70 +------------------------------------------------------+------------------------------------------------------+
71 | ip                                                   | ip address of Fluentd server                         |
72 +------------------------------------------------------+------------------------------------------------------+
73 | port                                                 | port number of Fluentd serverd                       |
74 +------------------------------------------------------+------------------------------------------------------+
75
76 An example of configuration for Fluentd working at 127.0.0.1:24224 and tags for logging is nfvbench
77 and result is resultnfvbench
78
79 .. code-block:: bash
80     fluentd:
81         # by default (logging_tag is empty) nfvbench log messages are not sent to fluentd
82         # to enable logging to fluents, specify a valid fluentd tag name to be used for the
83         # log records
84         logging_tag: nfvbench
85
86         # by default (result_tag is empty) nfvbench results are not sent to fluentd
87         # to enable sending nfvbench results to fluentd, specify a valid fluentd tag name
88         # to be used for the results records, which is different than logging_tag
89         result_tag: resultnfvbench
90
91         # IP address of the server, defaults to loopback
92         ip: 127.0.0.1
93
94         # port # to use, by default, use the default fluentd forward port
95         port: 24224
96
97 Example of logs and results
98 ---------------------------
99
100 An example of log obtained from fluentd by elasticsearch:
101
102 .. code-block:: bash
103
104     {
105       "_index": "nfvbench-2017.10.17",
106       "_type": "fluentd",
107       "_id": "AV8rhnCjTgGF_dX8DiKK",
108       "_version": 1,
109       "_score": 3,
110       "_source": {
111         "loglevel": "INFO",
112         "message": "Service chain 'PVP' run completed.",
113         "@timestamp": "2017-10-17T18:09:09.516897+0000",
114         "runlogdate": "2017-10-17T18:08:51.851253+0000"
115       },
116       "fields": {
117         "@timestamp": [
118           1508263749516
119         ]
120       }
121     }
122
123
124
125 For each packet size and rate a result record is sent. Users can label those results by passing
126 --user-label parameter to NFVbench run
127
128 .. code-block::bash
129     nfvbench --rate 1% --user-label nfvbench-label
130
131 And the results of this command obtained from fluentd by elasticsearch:
132
133 .. code-block:: bash
134
135     {
136       "_index": "resultnfvbench-2017.10.17",
137       "_type": "fluentd",
138       "_id": "AV8rjYlbTgGF_dX8Drl1",
139       "_version": 1,
140       "_score": null,
141       "_source": {
142         "compute_nodes": [
143           "nova:compute-3"
144         ],
145         "total_orig_rate_bps": 200000000,
146         "@timestamp": "2017-10-17T18:16:43.755240+0000",
147         "frame_size": "64",
148         "forward_orig_rate_pps": 148809,
149         "flow_count": 10000,
150         "avg_delay_usec": 6271,
151         "total_tx_rate_pps": 283169,
152         "total_tx_rate_bps": 190289668,
153         "forward_tx_rate_bps": 95143832,
154         "reverse_tx_rate_bps": 95145836,
155         "forward_tx_rate_pps": 141583,
156         "chain_analysis_duration": "60.091",
157         "service_chain": "PVP",
158         "version": "1.0.10.dev1",
159         "runlogdate": "2017-10-17T18:10:12.134260+0000",
160         "Encapsulation": "VLAN",
161         "user_label": "nfvbench-label",
162         "min_delay_usec": 70,
163         "profile": "traffic_profile_64B",
164         "reverse_rx_rate_pps": 68479,
165         "reverse_rx_rate_bps": 46018044,
166         "reverse_orig_rate_pps": 148809,
167         "total_rx_rate_bps": 92030085,
168         "drop_rate_percent": 51.6368455626846,
169         "forward_orig_rate_bps": 100000000,
170         "bidirectional": true,
171         "vSwitch": "OPENVSWITCH",
172         "sc_count": 1,
173         "total_orig_rate_pps": 297618,
174         "type": "single_run",
175         "reverse_orig_rate_bps": 100000000,
176         "total_rx_rate_pps": 136949,
177         "max_delay_usec": 106850,
178         "forward_rx_rate_pps": 68470,
179         "forward_rx_rate_bps": 46012041,
180         "reverse_tx_rate_pps": 141586
181       },
182       "fields": {
183         "@timestamp": [
184           1508264203755
185         ]
186       },
187       "sort": [
188         1508264203755
189       ]
190     }