chu11 / freeipmi-mirror

Mirror of GNU FreeIPMI Git Repo - http://savannah.gnu.org/projects/freeipmi/. I maintain the upstream of FreeIPMI and can accept Github pull requests.
GNU General Public License v3.0
12 stars 16 forks source link

ipmi-sel: more granular datetime ranges #57

Closed mert-kirpici closed 1 year ago

mert-kirpici commented 1 year ago

This is a feature request.

Since SEL entry timestamps are UNIX timestamps, they have a resolution of 1 second. Currently the --date-range command line option has a resolution of 1 day. It would be nice to be able to have more granular setting.

I was thinking about extending --date-range to accept ISO 8601 style %Y-%m-%dT%H:%M:%S or introducing new include/exclude --datetime-range option pair that accepts it? I am also willing to propose an implementation for this if the proposal is accepted.

chu11 commented 1 year ago

hi @mert-kirpici, this seems like a good idea. Yeah, my only concern would be supporting backwards compatibility given the (hindsight 20/20) poorly chosen date-range format I first implemented (allowing dashes or slashes in dates).

Skimming the ipmi-sel date range parsing, I think backwards compatibility with the current --date-range options should be doable / not horrible. I think adding to the current list of various strptime() calls should be all that is needed (although that code should maybe be cleaned up).

Feel free to give it a shot, will be glad to review a PR.