Created
November 18, 2025 14:38
-
-
Save half2me/9f8d397dfbd7f6d5a499be81f260638d to your computer and use it in GitHub Desktop.
Scalyr power query for parsing go's time.Duration string as seconds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| | parse "$h{regex=(\\d+)}$h" from duration | |
| | parse "$m{regex=(\\d+)}$m" from duration | |
| | parse "$s{regex=(\\d+)}$s" from duration | |
| | let duration_sec = s+60*m+3600*h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment