|
| 1 | +Collector configuration |
| 2 | +======================= |
| 3 | + |
| 4 | +IPFIXcol is designed to be easily extensible by input, intermediate and output plugins. |
| 5 | +Therefore, the startup configuration of the collector consists of 3 parts, each for one type of |
| 6 | +plugins, as illustrated below. The collector typically receives data from exporters and stores |
| 7 | +them on local drive or forward them to another destination. Hence, every startup configuration |
| 8 | +contains description of at least one instance of an input plugin and one instance of an output |
| 9 | +plugin. The intermediate section can be omitted, if not required. |
| 10 | + |
| 11 | +.. code-block:: xml |
| 12 | +
|
| 13 | + <ipfixcol2> |
| 14 | + <inputPlugins> |
| 15 | + ... |
| 16 | + </inputPlugins> |
| 17 | +
|
| 18 | + <intermediatePlugins> |
| 19 | + ... |
| 20 | + </intermediatePlugins> |
| 21 | +
|
| 22 | + <outputPlugins> |
| 23 | + ... |
| 24 | + </outputPlugins> |
| 25 | + </ipfixcol2> |
| 26 | +
|
| 27 | +A plugin documentation always provides description of parameters and configuration snippet |
| 28 | +that can be easily copied into your configuration. However, keep in mind that some parameters |
| 29 | +should be modified, for example, a storage directory of an output plugin, etc. |
| 30 | + |
| 31 | +Input plugins |
| 32 | +------------- |
| 33 | + |
| 34 | +The main purpose of the collector is to process flow data. To receive and process them, |
| 35 | +input plugins are essential. Thus, one or more instances of input plugins must defined within |
| 36 | +``<inputPlugins>`` section. First, let's look at what is composed of: |
| 37 | + |
| 38 | +.. code-block:: xml |
| 39 | +
|
| 40 | + <input> |
| 41 | + <name>...</name> |
| 42 | + <plugin>...</plugin> |
| 43 | + <params>...</params> |
| 44 | + </input> |
| 45 | +
|
| 46 | +:``name``: |
| 47 | + User identification of the instance. Must be unique within the section. |
| 48 | +:``plugin``: |
| 49 | + Internal identification of a plugin to whom the instance belongs. The identification |
| 50 | + is assigned by an author of the plugin. |
| 51 | +:``params``: |
| 52 | + Configuration parameters of the instance. The parameters varies from plugin to plugin. |
| 53 | + For help, see documentation of individual plugins. |
| 54 | + |
| 55 | +For example, this is how a configuration of `TCP <../../src/plugins/input/tcp>`_ input plugin |
| 56 | +could look like: |
| 57 | + |
| 58 | +.. code-block:: xml |
| 59 | +
|
| 60 | + <input> |
| 61 | + <name>TCP collector</name> |
| 62 | + <plugin>tcp</plugin> |
| 63 | + <params> |
| 64 | + <localPort>4739</localPort> |
| 65 | + <localIPAddress></localIPAddress> |
| 66 | + </params> |
| 67 | + </input> |
| 68 | +
|
| 69 | +Intermediate plugins |
| 70 | +-------------------- |
| 71 | + |
| 72 | +Now we have flow data inside the collector, but what if we want to modify or enrich them. |
| 73 | +Intermediate plugins are here to help. On the other hand, if modifications are not |
| 74 | +required, the whole section can be omitted. Thus, zero or more instances of intermediate |
| 75 | +plugins can be defined inside ``<intermediatePlugins>`` section. |
| 76 | + |
| 77 | +Although the order of input and output instances in a configuration doesn't matter, in case of |
| 78 | +intermediate plugins, it is important because it represents order of flow processing inside |
| 79 | +the internal data pipeline. |
| 80 | + |
| 81 | +Let's look at what the definition of an intermediate instance is composed of: |
| 82 | + |
| 83 | +.. code-block:: xml |
| 84 | +
|
| 85 | + <intermediatePlugins> |
| 86 | + <name>...</name> |
| 87 | + <plugin>...</plugin> |
| 88 | + <params>...</params> |
| 89 | + </intermediatePlugins> |
| 90 | +
|
| 91 | +As you can see, the structure of configuration is almost equivalent to the structure of |
| 92 | +input instances. They differ only in the element name, but parameter meaning is still the same. |
| 93 | + |
| 94 | +Output plugins |
| 95 | +-------------- |
| 96 | + |
| 97 | +Flow records are already prepared by input and intermediate plugins. The next step is to store them |
| 98 | +on local drive or forward to another destination for further processing. For these reasons, |
| 99 | +one or more instances of output plugins must be defined inside ``<outputPlugins>`` section. |
| 100 | +Again, the structure of an instance definition looks pretty similar like before. |
| 101 | + |
| 102 | +.. code-block:: xml |
| 103 | +
|
| 104 | + <output> |
| 105 | + <name>...</name> |
| 106 | + <plugin>...</plugin> |
| 107 | + <params>...</params> |
| 108 | + </output> |
| 109 | +
|
| 110 | +By default, an instance processes all records that are received by input plugins. Howerever, each |
| 111 | +output instance also supports *optional* Observation Domain ID (ODID) filter. |
| 112 | +What does it mean for you? Let's say you have multiple exporters monitoring your network. |
| 113 | +These exporters typically allows you to set an ODID associated to exported flow records so |
| 114 | +you can easily distinguish their origin. On the collector side, the ODID filter of an output |
| 115 | +instance allows you to select a range of ODIDs that should be processed by the particular instance. |
| 116 | +Flows from other sources are ignored. |
| 117 | + |
| 118 | +How can you use it? One of many common use-cases is that if you want to store flow data |
| 119 | +from different exporters to different output directories you can create multiple instances |
| 120 | +of the same output plugin with similar configurations and different ODID filters. |
| 121 | +Another use-case that is also worth mentioning is load-balancing. For example, when |
| 122 | +conversion of flow to JSON is not fast enough, you can try to split flows into multiple |
| 123 | +groups based on their ODID and process each group by an independent instance of the plugin. |
| 124 | + |
| 125 | +To enable the optional ODID filter, use one of the following parameter that takes a filter |
| 126 | +expression as an argument: |
| 127 | + |
| 128 | +:``<odidOnly>``: Process flows only from the selected ODID range |
| 129 | +:``<odidExcept>``: Process all flows except those from the selected ODID range |
| 130 | + |
| 131 | +The filter expression is represented as comma separated list of unsigned numbers |
| 132 | +and intervals. Interval is all the numbers between two given numbers separated by a dash. |
| 133 | +If one number of the interval is missing, the minimum or the maximum is used by default. |
| 134 | +For example, "1-5, 7, 10-" represents all ODIDs except 0, 6, 8 and 9 |
| 135 | + |
| 136 | +.. code-block:: xml |
| 137 | +
|
| 138 | + <output> |
| 139 | + ... |
| 140 | + <odidOnly>...</odidOnly> |
| 141 | + <!-- or --> |
| 142 | + <odidExcept>...</odidExcept> |
| 143 | + ... |
| 144 | + </output> |
| 145 | +
|
| 146 | +See documentation of your exporters how to configure exported ODID. It is recommended that |
| 147 | +ODIDs are unique per exporter. Note: In case of NetFlow devices, ODID is often referred as |
| 148 | +"Source ID". |
| 149 | + |
| 150 | +Example configuration files |
| 151 | +--------------------------- |
| 152 | + |
| 153 | + |
| 154 | +Multiple instance of different input plugins |
| 155 | +Multiple instances of the same plugin processing different ODID range (load balancing) |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +Try your configuration |
| 162 | +---------------------- |
| 163 | + |
| 164 | +TOOD: how to start collector with a configuraton |
| 165 | +- just call ``ipfixcol2 -c <config_file>``. |
| 166 | + |
| 167 | +TODO: if your configuration is ready to use, you can also store to the default path |
| 168 | +where the collector looks for it... often it is /etc/ipfixcol/startup.xml |
| 169 | +however based on your OS and build configuration of the collector path can vary. |
| 170 | +Use ``ipfixcol2 -h`` to see default paths on your system. Then you can start collector |
| 171 | +by calling only ``ipfixcol2`` (without parameters) |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | +Verbosity |
| 178 | +--------- |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | +TODO: order of input/output plugin doesn't depend... order of intermediate plugins is significant |
| 183 | +TODO: verbosity level |
| 184 | +TODO: odid filter |
| 185 | +TODO: multiple instances of the same plugin can be used... for example TCP, UDP, etc.. |
| 186 | +TODO: where the collector search for plugins?? |
| 187 | + |
| 188 | +The fundamental objective of the collector is an emphasis on high performance. To reach this |
| 189 | +goal, each instance is executed by its own thread. This makes possible to run simultaneously |
| 190 | +multiple input, intermediate and output instances and at the same effectively use system resources. |
| 191 | + |
| 192 | +Even instances of the same plugin can run concurrently. However, instances must have slightly |
| 193 | +different configurations. For example, instances of output plugins should not write to the same |
| 194 | +directory, instances of input plugins cannot listen on the same port and interface, etc. |
| 195 | + |
| 196 | +Just like everywhere else your collector is as fast as the slowest plugin in the configuration. |
0 commit comments