Kafka consumer connector time_of_event_field and date_format value with epoch time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 03:34 AM
Hi
We have a Kafka connector instance which is collecting events from a Kafka topic. It is possible to set the time_of_event_field from a field in the Kafka payload, and we have a field we would like to use (timestamp_kafka). The problem is that the timestamp is in epoch time format with milliseconds (i.e 1700216358002) and the documentation (https://docs.servicenow.com/csh?topicname=configure-kafka-consumer-connector.html&version=latest) does not say how I can set the date_format field to make ServiceNow understand the format in the time_of_event_field when the timestamp is in epoch time.
Does anyone know?
- Labels:
-
Event Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 11:43 PM
After digging into the Kafka connector Javascript code I found out that the Kafka connector use the Java class SimpleDateFormat (https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html) to parse the time_of_event_field. It looks like the class is unable to parse epoch time. It is strange to think that epoch time is not supported in the time_of_event_field.
