cli icon indicating copy to clipboard operation
cli copied to clipboard

Using absolute time while searching

Open arunmathews opened this issue 4 years ago • 1 comments

How can I pass in an absolute time when running a search using the cli ? When I tried it like this

humioctl ... -s 1640040603936

I got the error

Could not parse 6 to a known time unit. unit=6
humioctl -v
humioctl 0.28.11 (f128a9f6232a8bcebc942e2e228a55fc8f9a6ae7 on 2021-10-25T10:52:26Z)

arunmathews avatar Dec 24 '21 01:12 arunmathews

I think this is due to https://github.com/humio/cli/blob/74bc201b311368d35357ee49bc9a0abc09029c76/api/search.go#L21-L22

Perhaps this could be interface{} instead? when this changes, the request is sent as an int and Humio can then parse the exact time, not relative when sent as string.

Alternative could perhaps be to check if int, and type assert before sending out the request..

ryjogo avatar Apr 18 '22 09:04 ryjogo