These sections describe a method of load balancing logs between multiple AxoSyslog destinations. The first subsection describes the round robin load balancing method based on the R_MSEC macro of AxoSyslog, while the second subsection describes a configuration generator that you can use as an alternative to using the example configuration described in the first subsection.
For more information about the R_MSEC macro and further macros of AxoSyslog, see Macros of AxoSyslog.
1 - Load balancing with a round robin load balancing method based on the R_MSEC macro
This section describes a round robin load balancing method based on the R_MSEC macro of AxoSyslog to load balance your logs between multiple AxoSyslog destinations.
Note
If R_MSEC is not precise enough, you can replace it with R_USEC (which uses microseconds instead of milliseconds).
For more information about the R_MSEC macro and further macros of AxoSyslog, see Macros of AxoSyslog.
Example: round robin load balancing between multiple destinations
The following example is a round-robin load balancing method, based on AxoSyslog’s R_MSEC macro.
The filter {" <return value >" == "$(% ${R_MSEC} 2)"}; code snippets (in bold) serve as the basis of the method. This filter separates incoming log messages’ timestamp values based on the R_MSEC macro, using a division with remainder method, and distributes the log messages equally between two destinations based on the return value (in this case, 0 or 1).
If you need a file instead of a network destination, replace the network destination with the file in the example (and use the same analogy for any other AxoSyslog destinations).
2 - Configuration generator for the load balancing method based on MSEC hashing
This section describes a configuration generator SCL for the load balancing method based on MSEC hashing to load balance your logs between multiple AxoSyslog destinations.
Also consider that the configuration generator script may change incompatibly in the future. As a result, Axoflow does not officially support using this script, and recommends that you only use this script at your own risk.