icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading Scale Command
SHA256 checksum (scale-command_02.tgz) 0f13740122b474582bcf996fbbd3a8352b1c72497dde69694293036063ed5dc9 SHA256 checksum (scale-command_01.tgz) 056a9ed7b1763e1c504a7a8e3298badd397fd010651f23df58a388288568f07d
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

Scale Command

This app has been archived. Learn more about app archiving.
This app is NOT supported by Splunk. Please read about what that means for you here.
Overview
Details
Provides a scale command capable of handling fields based on a regular expression.

Using the scale command, you can scale fields matching a pattern by a fixed scale or by a field from each event. This replaces multiple calls to eval for transforming several fields from one unit to the other, such as byte to Megabyte. Optionally you can specify rounding to any precision and choose between division and multiplication to scale up or down easily.

Examples

... | scale scale=1048576 pattern=byte round=0

Converts fields matching the pattern "byte" to megabyte, rounding to whole MB.

... | scale scale=60 pattern="^[^_]"

Converts every numeric field not starting with an underscore, e.g. _time, from seconds to minutes.

... | scale field=Total pattern="^sum" | scale scale=100 pattern="^sum" round=2 inverse=t

Translates every field starting with "sum" into percentages of Total, rounded to two decimal places.

Examples expressed using the Splunk 6 foreach command

Here's how the examples from above would look like using the foreach command added in Splunk 6:

... | foreach *byte* [eval <<FIELD>> = round(<<FIELD>> / 1048576)]

Matching for "field doesn't start with an underscore" isn't possible with only wildcards, so example 2 still requires the scale command.

... | foreach sum* [eval <<FIELD>> = round(<<FIELD>> / Total * 100, 2)]

Syntax

scale (scale= | field=) pattern= [round=] [inverse=t]

Release Notes

Version 0.2
March 7, 2013

Added support for scaling by a field.

Version 0.1
Feb. 15, 2013

Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk Inc. in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.