-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref(data-forwarding): More directly use the plugin forwarding #103936
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
Conversation
❌ 4 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
c3ad03b to
488f6e0
Compare
| ) -> dict[str, Any]: | ||
| return { | ||
| "time": int(event.datetime.timestamp()), | ||
| "time": int(event.datetime.strftime("%s")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Non-portable timestamp conversion using strftime
The strftime("%s") format code is a Unix-specific extension not supported on Windows or in standard Python. This will cause the Splunk forwarder to fail on Windows systems. The portable way to get a Unix timestamp is using event.datetime.timestamp() instead of int(event.datetime.strftime("%s")).
| } | ||
| props["tags"] = [[tagstore.backend.get_standardized_key(k), v] for k, v in event.tags] | ||
| props["tags"] = [ | ||
| [k.format(tagstore.backend.get_standardized_key(k)), v] for k, v in event.tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect string format call on tag key
The tag processing incorrectly calls k.format(tagstore.backend.get_standardized_key(k)) where k is a tag key string. The format() method expects format placeholders like {}, but tag keys don't contain these. This should be just tagstore.backend.get_standardized_key(k) without the .format() call, which will either fail or produce unexpected output.
Should resolve some issues with data forwarders
as_dictinstead ofserializeFor Splunk, I opted to use the legacy SplunkApiClient, we can migrate off of it later and it's easier to match it for now.