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