Issues with Timestamp Format in Zinc-Observe API Query

TLDR Rex faced an issue with the timestamp format in Zinc-Observe API query. Hengfei pointed out that start and end times should be in i64 and in microseconds as per the search document.

Photo of Rex
Rex
Sun, 26 Feb 2023 20:45:08 UTC

Afternoon everyone, using as a reference im trying to do a query against the (zinc-observe) api. It seems to want the start and end times in a specific format, but doesn't return an error if it is given a timestamp that does not conform to that format (and if theres a specific format, should it be documented?). should i open a issue for this? Using timestamps in this form: `start.timestamp()` returns: invalid type: floating point `1677441308.789123`, expected i64 at line 1 column 82 Using _`int(start.timestamp())` :_ {"took":19,"hits":[],"total":0,"from":0,"size":10,"scan_size":0} Using: _`int(f"{int(start.timestamp())}006000")` returns the expected results_

Photo of Prabhat
Prabhat
Mon, 27 Feb 2023 01:19:25 UTC

Can you share your query

Photo of Prabhat
Prabhat
Mon, 27 Feb 2023 01:19:38 UTC

in json format

Photo of Prabhat
Prabhat
Mon, 27 Feb 2023 01:20:00 UTC

are you able to use the query using postman?

Photo of Hengfei
Hengfei
Mon, 27 Feb 2023 01:28:57 UTC

We already have it in the search document, you should have a look the description table, it said start_time and end_time should be i64 and unit is micro timestamp

Photo of Rex
Rex
Mon, 27 Feb 2023 01:49:02 UTC

Thanks for the replies. I did not try in postman, I was building the timestamps dynamically in python. I can see the reference to microseconds in the docs now. Cheers