You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am receiving flows in following format. Is it possible to change header names. Want to get rid of "@type": "ipfix.entry" and first entries like iana: , ipfix: Basically want to remove the PEN entry appended to every header.
Activity
xoredbyte commentedon Oct 24, 2025
You need to modify the code in the libfds repository (https://github.com/CESNET/libfds/) in the json.c file located at libfds/src/converters as below:
Comment out the code portion
/*
// Add a string identifier
const size_t scope_size = strlen(def->scope->name);
const size_t elem_size = strlen(def->name);
*/
//Replace with this
// Add a string identifier (MODIFIED - without scope prefix)
const size_t elem_size = strlen(def->name);
// Only need space for: 2x '"' + ':' + element name + '\0'
size_t size = elem_size + 4; // 2x '"' + ':' + '\0'
int ret_code = buffer_reserve(buffer, buffer_used(buffer) + size);
if (ret_code != FDS_OK) {
return ret_code;
}
*(buffer->write_begin++) = '"';
// Removed: memcpy(buffer->write_begin, def->scope->name, scope_size);
// Removed: buffer->write_begin += scope_size;
// Removed: *(buffer->write_begin++) = ':';
// Only copy the element name (no scope prefix)
memcpy(buffer->write_begin, def->name, elem_size);
buffer->write_begin += elem_size;
*(buffer->write_begin++) = '"';
*(buffer->write_begin++) = ':';
Then recompile libfds with
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
$ make
$ make install