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
{{ message }}
Repository navigation
Unable to add current timestamp in Transformation Script for File Replay Adapter
#4777
I wanted to use the Transformation Script feature in the Adapter Editor to add the current timestamp as the event timestamp.
Like in teh doumentation the "processedAt" timestamp.
I'm testing this with the File Replay Adapter on StreamPipes 0.99-SNAPSHOT (all components are running the same version).
I tried both of the following transformation scripts:
function transform(event, out, ctx) {
event.timestampNow = Date.now();
out.collect(event);
}
and
function transform(event, out, ctx) {
utils.addTimestamp(event, "timestampNow");
out.collect(event);
}
In the Field Editor, I selected the newly added field (timestampNow) as the event timestamp.
However, when I start the adapter, I get the following error:
org.apache.streampipes.commons.exceptions.connect.AdapterException:
The timestamp field in the original input event must be numeric.
The file replay adapter requires a Unix timestamp to be present in the original input data.
Field: timestampNow, value: null
Is there something wrong with my transformation script, or is the File Replay Adapter validating the timestamp before the transformation script is executed?
If the latter is the case, is there another way to use the current time as the event timestamp for replayed events?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I wanted to use the Transformation Script feature in the Adapter Editor to add the current timestamp as the event timestamp.
Like in teh doumentation the "processedAt" timestamp.
I'm testing this with the File Replay Adapter on StreamPipes 0.99-SNAPSHOT (all components are running the same version).
I tried both of the following transformation scripts:
and
In the Field Editor, I selected the newly added field (timestampNow) as the event timestamp.
However, when I start the adapter, I get the following error:
Is there something wrong with my transformation script, or is the File Replay Adapter validating the timestamp before the transformation script is executed?
If the latter is the case, is there another way to use the current time as the event timestamp for replayed events?
All reactions