Format a duration into a human readable string.

ParameterTypeRequiredDefaultDescription
asstringfalse The output name of the field to set (defaults to the same as the input field).
fieldstringtrue The name of the input field. [a]
fromstringfalsemsMagnitude of the input field.
  Valid ValuesdDays
   hHours
   mMinutes
   msMilliseconds
   nsNanoseconds
   sSeconds
   usMicroseconds
precisionnumberfalse0Number of units to use in the output.

[a] If an argument name is not given, field is the default argument.

Formats a duration into a string. An input event with the field duration with the value 23452553 results in the field duration having the value 6h30m52s553ms.

logscale
formatDuration(duration)

Formats a duration into a string with limited precision. An input event with the field duration with the value 23452553 results in the field duration having the value 6h30m52s.

logscale
formatDuration(duration, precision=3)