Skip to content

Instantly share code, notes, and snippets.

@half2me
Created November 18, 2025 14:38
Show Gist options
  • Select an option

  • Save half2me/9f8d397dfbd7f6d5a499be81f260638d to your computer and use it in GitHub Desktop.

Select an option

Save half2me/9f8d397dfbd7f6d5a499be81f260638d to your computer and use it in GitHub Desktop.
Scalyr power query for parsing go's time.Duration string as seconds
| 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