Reporting

What does the "LIMIT" operator in Pivot do?

rjthibod
Champion

The documentation for Pivot has included a "LIMIT" operator for quite some time, yet there is no explanation of what it does or how to use it. I have not yet seen any examples that use it either. Can someone shed some light on this?

Here is the snippet of documentation from the Pivot Knowledgebase page. This is all. There is nothing else mentioned.

Descriptions for limit elements
   Limit <limit expression>
       Syntax: LIMIT <fieldname> BY <limittype> <number> <stats-function>(<fieldname>)
       Description:
Tags (1)
0 Karma
1 Solution

lstewart_splunk
Splunk Employee
Splunk Employee

Hello rjthibod

Thank you for pointing out this missing information. I've updated the documentation as well. Hope this helps!

Limit limit expression
Syntax: LIMIT fieldname BY limittype number stats-function(fieldname)

Description: Use to limit the number of elements in the pivot. The limittype argument specifies where to place the limit. The valid values are top or bottom. The number argument must be a positive integer. You can use any stats function, such as min, max, avg, and sum.

Example: LIMIT foo BY TOP 10 avg(bar)

View solution in original post

lstewart_splunk
Splunk Employee
Splunk Employee

Hello rjthibod

Thank you for pointing out this missing information. I've updated the documentation as well. Hope this helps!

Limit limit expression
Syntax: LIMIT fieldname BY limittype number stats-function(fieldname)

Description: Use to limit the number of elements in the pivot. The limittype argument specifies where to place the limit. The valid values are top or bottom. The number argument must be a positive integer. You can use any stats function, such as min, max, avg, and sum.

Example: LIMIT foo BY TOP 10 avg(bar)

rjthibod
Champion

Thank you very much.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...