forked from CESNET/ipfixcol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ipfixcol-json-output.dbk
366 lines (330 loc) · 10.8 KB
/
ipfixcol-json-output.dbk
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<?xml version="1.0" encoding="utf-8"?>
<refentry
xmlns:db="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xlink http://docbook.org/xml/5.0/xsd/xlink.xsd
http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd"
version="5.0" xml:lang="en">
<info>
<copyright>
<year>2017</year>
<holder>CESNET, z.s.p.o.</holder>
</copyright>
<date>15 August 2017</date>
<authorgroup>
<author>
<personname>
<firstname>Michal</firstname>
<surname>Kozubik</surname>
</personname>
<email>[email protected]</email>
<contrib>developer</contrib>
</author>
<author>
<personname>
<firstname>Lukas</firstname>
<surname>Hutak</surname>
</personname>
<email>[email protected]</email>
<contrib>developer</contrib>
</author>
<author>
<personname>
<firstname>Petr</firstname>
<surname>Velan</surname>
</personname>
<email>[email protected]</email>
<contrib>developer</contrib>
</author>
</authorgroup>
<orgname>The Liberouter Project</orgname>
</info>
<refmeta>
<refentrytitle>ipfixcol-json-output</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo otherclass="manual" class="manual">JSON output plugin for IPFIXcol.</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ipfixcol-json-output</refname>
<refpurpose>JSON output plugin for IPFIXcol.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<simpara>
The <command>ipfix-json-output</command> plugin is a part of IPFIXcol (IPFIX collector). It converts IPFIX data into JSON format (each data set is an array of data records).
Some elements (timestamp, IP, MAC, tcp flags...) are converted into human readable format. Others are represented as plain numbers.
</simpara>
</refsect1>
<refsect1>
<title>Configuration</title>
<simpara>The collector must be configured to use json output plugin in startup.xml configuration (<filename>/etc/ipfixcol/startup.xml</filename>).
The configuration specifies which plugins (destinations) are used by the collector to store data and provides configuration for the plugins themselves.
</simpara>
<simpara><filename>startup.xml</filename> json example</simpara>
<programlisting>
<![CDATA[
<destination>
<name>JSON storage plugin</name>
<fileWriter>
<fileFormat>json</fileFormat>
<metadata>no</metadata>
<tcpFlags>formatted</tcpFlags>
<timestamp>formatted</timestamp>
<protocol>formatted</protocol>
<ignoreUnknown>yes</ignoreUnknown>
<nonPrintableChar>yes</nonPrintableChar>
<prefix>ipfix.</prefix>
<output>
<type>print</type>
</output>
<output>
<type>send</type>
<ip>127.0.0.1</ip>
<port>4444</port>
<protocol>udp</protocol>
</output>
<output>
<type>file</type>
<path>/tmp/ipfixcol/flow/%Y/%m/%d/</path>
<prefix>json.</prefix>
<dumpInterval>
<timeWindow>300</timeWindow>
<timeAlignment>yes</timeAlignment>
</dumpInterval>
</output>
<output>
<type>server</type>
<port>4800</port>
<blocking>no</blocking>
</output>
<output>
<type>kafka</type>
<ip>127.0.0.1</ip>
<port>9092</port>
<partitions>2</partitions>
<topic>ipfix.kafkaexport</topic>
</output>
</fileWriter>
</destination>
]]>
</programlisting>
<para>
<variablelist>
<varlistentry>
<term><command>fileFormat</command></term>
<listitem>
<simpara>Same as in <filename>internalcfg.xml</filename> file.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>metadata</command></term>
<listitem>
<simpara>Add record metadata to the output (yes/no) [default == no].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>tcpFlags</command></term>
<listitem>
<simpara>Convert TCP flags to formatted style of dots and letters (formatted) or to a number (raw) [default == raw].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>timestamp</command></term>
<listitem>
<simpara>Convert time to formatted style (formatted) or to a number (unix) [default == unix].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>protocol</command></term>
<listitem>
<simpara>Convert protocol identification to formatted style (formatted) or to a number (raw) [default == formatted].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>ignoreUnknown</command></term>
<listitem>
<simpara>Skip elements with unknown semantics (yes/no). Data of unknown elements are formatted as unsigned integer (1, 2, 4, 8 bytes length) or binary values. Names will have format 'eXXidYY' where XX is enterprise number and YY is element ID [default == yes].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>nonPrintableChar</command></term>
<listitem>
<simpara>Convert non-printable characters (control characters, tab, newline, etc.) from IPFIX fields with data type of a string. (yes/no) [default == yes].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>prefix</command></term>
<listitem>
<simpara>Prefix of the IPFIX element names. [default == ipfix.].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>output</command></term>
<listitem>
<simpara>JSON data processor. Multiple outputs are supported.</simpara>
<varlistentry>
<term><command>type</command></term>
<listitem>
<simpara>Output type. <command>print</command>, <command>send</command>, <command>file</command>, <command>server</command>, and <command>kafka</command> are supported.</simpara>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
<varlistentry>
<term><command>output - print</command></term>
<listitem>
<simpara>Writes data to the standard output.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>output - send</command></term>
<listitem>
<simpara>Sends data over the network.</simpara>
<varlistentry>
<term><command>ip</command></term>
<listitem>
<simpara>IPv4/IPv6 address of remote host (default 127.0.0.1).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>port</command></term>
<listitem>
<simpara>Remote port number (default 4739).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>protocol</command></term>
<listitem>
<simpara>Connection protocol, one of UDP/TCP/SCTP (default UDP). This field is case insensitive.</simpara>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
<varlistentry>
<term><command>output - file</command></term>
<listitem>
<simpara>Store data to files.</simpara>
<varlistentry>
<term><command>path</command></term>
<listitem>
<simpara>The path specifies storage directory for data collected by JSON plugin. Path can contain format specifier for day, month, etc. This allows you to create directory hierarchy based on format specifiers. See <command>strftime</command> for conversion specification.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>prefix</command></term>
<listitem>
<simpara>Specifies name prefix for output files.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>dumpInterval</command></term>
<listitem>
<varlistentry>
<term><command>timeWindow</command></term>
<listitem>
<simpara>Specifies the time interval in seconds to rotate files [default == 300].</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>timeAlignment</command></term>
<listitem>
<simpara>Align file rotation with next N minute interval [default == yes].</simpara>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
<varlistentry>
<term><command>output - server</command></term>
<listitem>
<simpara>Sends data over the network to connected clients.</simpara>
<varlistentry>
<term><command>port</command></term>
<listitem>
<simpara>Local port number.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>blocking</command></term>
<listitem>
<simpara>Type of the connection. Blocking (yes) or non-blocking (no).</simpara>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
<varlistentry>
<term><command>output - kafka</command></term>
<listitem>
<simpara>Sends data to Kafka. Must be compiled with --enable-kafka, tested against version 0.8.6.</simpara>
<varlistentry>
<term><command>ip</command></term>
<listitem>
<simpara>Address of Kafka host.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>port</command></term>
<listitem>
<simpara>Port of Kafka host.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>partitions</command></term>
<listitem>
<simpara>Number of partitions to which send data. Uses round robin to send to partitions 0 - (N-1).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>topic</command></term>
<listitem>
<simpara>Kafka topic to send data to.</simpara>
</listitem>
</varlistentry>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para></para>
<para>
<variablelist>
<varlistentry>
<term>
<citerefentry><refentrytitle>ipfixcol</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</term>
<listitem>
<simpara>Man pages</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<link xlink:href="http://www.liberouter.org/technologies/ipfixcol/">http://www.liberouter.org/technologies/ipfixcol/</link>
</term>
<listitem>
<para>IPFIXcol Project Homepage</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<link xlink:href="http://www.liberouter.org">http://www.liberouter.org</link>
</term>
<listitem>
<para>Liberouter web page</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<email>[email protected]</email>
</term>
<listitem>
<para>Support mailing list</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>