The unix_timestamp() function emits the current event time as a numeric Unix timestamp, making time available alongside selected fields for filtering, comparison, or arithmetic. section 8.3
Use it in a stream query
SELECT unix_timestamp(), count(rand_value) FROM TAG:'random-num' WHERE rand_value > 0; produces a numeric timestamp and counts records whose rand_value exceeds zero. Output shows values such as 1702943626 and COUNT(rand_value)=1. section 8.3
Listing 8.3 Multiple stream processor definitions: query2.conf
[STREAM_TASK] name selectTaskWithTag exec SELECT record_tag(), rand_value FROM TAG:'random-num'; #1 [STREAM_TASK] name selectSumTask exec SELECT now(), sum(rand_value) FROM TAG:'random-num'; #2 [STREAM_TASK] name selectWhereTask exec SELECT unix_timestamp(), count(rand_value) FROM TAG:'random-num' WHERE rand_value > 0; #3
Inspect the complete query2.conf definition alongside related stream-processing tasks. section 8.3
