Skip to content

Commit 29b8e3c

Browse files
committed
Clickhouse - ignore records using options templates
Records using options templates would result in empty rows in the database because no data field would match. Currently we will just ignore them. Sometime in the future, if someone needs it, we can skip empty records to prevent them from being inserted instead and allow for options template records to also be stored.
1 parent ab7b327 commit 29b8e3c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

extra_plugins/output/clickhouse/src/plugin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ void Plugin::extract_values(ipx_msg_ipfix_t *msg, RecParser &parser, Block &bloc
144144
int
145145
Plugin::process_record(ipx_msg_ipfix_t *msg, fds_drec &rec, Block &block)
146146
{
147+
if (rec.tmplt->type == FDS_TYPE_TEMPLATE_OPTS) {
148+
// skip the data record if the template used is a options template
149+
// currently we only want data records using "normal" templates
150+
// this is to prevent empty records in the database and might be improved upon in the future
151+
return 0;
152+
}
153+
147154
int ret = 0;
148155
RecParser &parser = m_rec_parsers->get_parser(rec.tmplt);
149156
parser.parse_record(rec);

0 commit comments

Comments
 (0)