Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timestamped values #277

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ilario
Copy link

@ilario ilario commented Dec 7, 2023

Running the example from the readme, I didn't get any timestamp in the timestamped example from data.json.

I identified tree small issues, one in the example config.yml, another in the example data.json and another in the util.go's "SanitizeIntValue" function:

  • the key epochtimestamp in config.yml has to be in lower case
  • the timestamp in the data.json example, in order to be found following the instructions in the config.yml contained in the example folder, has to be inside the indicated path
  • the jsonpath processing converts a timestamp like 1757568506 to a string like "1.757568506e+09". strconv.ParseInt does not consider that as a valid integer and throws an error. So I parsed the number as a float and then I cast it into an int64. I added the math.Round function just for avoiding numerical issues (e.g. 1.999999 being converted to 1), but I don't know if this could happen here, so please delete it if you consider it useless.

Please check if the Go coding is correct, as I am not experienced with it at all.

Signed-off-by: Ilario Gelmetti <iochesonome@gmail.com>
Signed-off-by: Ilario Gelmetti <iochesonome@gmail.com>
Signed-off-by: Ilario Gelmetti <iochesonome@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant