Created
February 22, 2015 00:12
-
-
Save LukeMurphey/145b0903cd44498a9c75 to your computer and use it in GitHub Desktop.
Splunk readable duration macro Tags: #splunk
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
| # readable_duration | |
| # ----------------------------- | |
| # makes a human readable description of a duration | |
| # | |
| [readable_duration(2)] | |
| args = sourceField,destField | |
| definition = eval $destField$ = case( $sourceField$ > (2*86400), round(($sourceField$) / (86400)) . " days", $sourceField$ > (2*3600), round(($sourceField$) / (3600)) . " hours", $sourceField$ > (2*60), round(($sourceField$) / (60)) . " minutes", $sourceField$ > 0, $sourceField$ . " seconds" ) | |
| iseval = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment