Join the upcoming Developer Hackathon: Splunk Build-a-thon!Register now

 map()

On this page

Applies a lambda function to each value in each MTS in the stream.

 Syntax

map(lambda)

 Parameter definitions

ParameterTypeDescription
lambdalambda functionLambda function to apply to each value in each MTS in the input stream

Returns a stream.

 Examples

#Apply a lambda function to a stream
data('cpu.utilization').map(lambda x: x / 2).mean().sum(over='1h')

#Same thing without lambda
utilization = data('cpu.utilization')
(utilization/2).mean().sum(over='1h')\n