georgestarcher/Splunk-Class-httpevent

Timestamps in example.py payload.

Closed this issue · 2 comments

Many thanks for writing this library, it seems to work well.

HOWEVER, after running example.py and hacking it about, I was confused why all my events had the same timestamp.
Looking deeper, when the sendEvent method is invoked, it adds a "time": <epochTime> item to payload, which is not updated before the next time sendEvent is invoked.

I did an experiment and added del payload["time"] after each invocation of sendEvent, and now the events have unique timestamps.

I know this isn't an issue when you're not re-using the payload dictionary, but it had me scratching my head.

Once again, many thanks for sharing this library!

You should be putting a valid timestamp on your events. That is there to ensure there is at least a timestamp on them and if you post too fast you get in same window of time.

OK, many thanks. I will explicitly add a timestamp to my events from now on.