Splunk Search

Using 'by' clause overrides 'limit'?

palisetty
Communicator

I have used the following
source="C:\Users\spali\Downloads\products\*" host="DESKTOP-K35HBNT"
| top product_name price by Code limit=5

Code product_name price count percent
A Mediocre Kingdoms 24.99 1 100.000000
B Dream Crusher 39.99 1 100.000000
C Final Sequel 24.99 1 100.000000
D World of Cheese 24.99 1 100.000000
E World of Cheese Tee 9.99 1 100.000000
F Puppies vs. Zombies 4.99 1 100.000000
G Curling 2014 19.99 1 100.000000
H Manganiello Bros. 39.99 1 100.000000
I Manganiello Bros. Tee 9.99 1 100.000000
J Orvil the Wolverine 39.99 1 100.000000
K Benign Space Debris 24.99 1 100.000000
L SIM Cubicle 19.99 1 100.000000
M Holy Blade of Gouda 5.99 1 100.000000
N Fire Resistance Suit of Provolone 3.99 1 100.000000
O Grand Theft Scooter 24.99 1 100.000000
P SIM Cubicle Tee 9.99 1 100.000000

I should have got only 5, Why is that I am getting more than that?

Tags (2)
0 Karma

to4kawa
Ultra Champion

Because Code has 16 values.
limit is limited by each Code.

richgalloway
SplunkTrust
SplunkTrust

Have you tried top limit=5 product_name price by Code or top 5 product_name price by Code?

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...