Usage Of Splunk Eval Function: MVRANGE

Usage Of Splunk Eval Function: MVRANGE

“mvrange” is a eval function. We can use mvrange function to create a multivalue field for a range of numbers. This is very useful function for multivalue creation. 

Syntax:

| eval <field_name>=mvrange(X,Y,Z)

Here X is the starting number, Y is the ending number, Z is the number gap.

Example:

index=_internal
| head 1
| eval showrange=mvrange(1,10,3)
| table showrange

Explanation:

Here we want to show number between 1 and 10 with gap 3 so values will be 1,4,7.
In mvrange function first we have mentioned our starting number then our ending number after that we have given the number gap of range.

mv_range_gap

Now you can effectively utilize “mvrange” function with “eval” command to meet your requirement !!

Hope you are now comfortable in : Usage of Splunk EVAL Function : MVRANGE

Happy Splunking 🙂

You can also know about :  Usage Of Splunk Eval Function : RTRIM

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.