Skip to content

Commit 8fa5bc7

Browse files
committed
Add get_text() for mqtt plugin
1 parent bfe514a commit 8fa5bc7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

process/mqtt.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <ipfixprobe/utils.hpp>
3939
#include <numeric>
4040
#include <cstring>
41+
#include "sstream"
4142

4243
namespace ipxp {
4344

@@ -144,6 +145,18 @@ struct RecordExtMQTT : public RecordExt {
144145
return MQTT_UNIREC_TEMPLATE;
145146
}
146147
#endif
148+
std::string get_text() const override
149+
{
150+
std::ostringstream out;
151+
out << "type_cumulative=" << type_cumulative
152+
<< ",version=" << std::to_string(version)
153+
<< ",connection_flags=" << std::to_string(connection_flags)
154+
<< ",keep_alive=" << keep_alive
155+
<< ",connection_return_code=" << std::to_string(connection_return_code)
156+
<< ",publish_flags=" << std::to_string(publish_flags)
157+
<< ",topics=\"" << topics.str << "\"";
158+
return out.str();
159+
}
147160
};
148161

149162

0 commit comments

Comments
 (0)