fxnn / gowatch

Configurable logfile analysis for your server.
MIT License
8 stars 2 forks source link

Predicates on timestamps #9

Closed fxnn closed 9 years ago

fxnn commented 9 years ago

Each logentry has a timestamp. One must be able to compare them, at least based on the current time, or even with some given timestamp.

Therefore, we could have predicates as:

timestamp: {before: "-2d"} // not newer than 2 days in past
timestamp: {after: "-1h30m"} // not older than 1 hour and 30 minutes
timestamp: {after: "2015-01-01T00:00:00Z"} // in 2015

Note that the last version would need to use some fixed timestamp format. RFC3339 aka ISO 8601 feels right here.

fxnn commented 9 years ago

While absolute times are done, we still need to be able to compare with relative timestamps. While one Syntax proposal is already given, I find that rather unintuitive. An alternative could be

timestamp: {"younger than": "1h30m"}
timestamp: {"older than": "3d"}