Fix: proper format the data generated by the JQFilter to the one expected by the SP
@@ -23,6 +23,7 @@ import importlib
import logging
import datetime
import signal
+import json
import foglamp.plugins.north.common.common as plugin_common
@@ -718,7 +719,13 @@ class SendingProcess:
if data_to_send:
if self._config_from_manager['applyFilter']["value"].upper() == "TRUE":
jqfilter = JQFilter()
- data_to_send = jqfilter.transform(data_to_send, self._config_from_manager['filterRule']["value"])
+
+ # Steps needed to proper format the data generated by the JQFilter to the one expected by the SP
+ data_to_send_2 = jqfilter.transform(data_to_send, self._config_from_manager['filterRule']["value"])
+ data_to_send_3 = json.dumps(data_to_send_2)
+ data_to_send_4 = eval(data_to_send_3)
+ data_to_send = data_to_send_4[0]
+
data_sent, new_last_object_id, num_sent = self._plugin.plugin_send(self._plugin_handle, data_to_send, stream_id)
if data_sent:
# Updates reached position, statistics and logs the operation within the Storage Layer
