Spread Collectors

How-To Use the Spread Protocol

The instructions for using Spread in libfixbuf are similar to the setup for reading from IPFIX files. As described above in the Exporters section, the first step is to create an fbInfoModel_t and fbSession_t. Next, create the internal template(s) and add it to the fbSession_t. Define an fbSpreadParams_t and set the session, groups to subscribe to, and Spread Daemon name. Example usage:

char *groups[25];
groups[0] = strdup("group1");
groups[1] = '\0';
spread.daemon = "daemon1"
spread.groups = groups;
spread.session = session;
collector = fbCollectorAllocSpread(0, &spread, &err);
char * daemon
pointer to the daemon host address, in Spread format.
Definition public.h:1935
fbCollector_t * fbCollectorAllocSpread(void *ctx, fbSpreadParams_t *params, GError **err)
Allocates a collecting process endpoint for the Spread transport.
char ** groups
pointer to array of group names, must have at least one, and must be null term array
Definition public.h:1938
fbSession_t * session
pointer to the session, this MUST be set to a valid session before the spec is passed to fbExporterAl...
Definition public.h:1932
Spread connection parameters.
Definition public.h:1929

Then create an fbCollector_t to connect and listen to the Spread Daemon using fbCollectorAllocSpread().

With an fbSession_t and fbCollector_t available, create a buffer for writing via fBufAllocForCollection(). Set the internal template ID with fBufSetInternalTemplate(), and use fBufNext() to read records from IPFIX Messages published to the group your collector is subscribing to.

To view all the Spread Groups that were sent the incoming record, call fbCollectorGetSpreadReturnGroups() on the collector.