Deployment Architecture

How do I get a count of unique and total buckets in my environment?

davidpaper
Contributor

I want to know how many buckets I have in my indexing clustered environment, both the total count of all buckets and how many of them are unique.

1 Solution

davidpaper
Contributor

On the cluster master, the following search provides answers to both questions.

| rest splunk_server=local /services/cluster/master/peers 
| stats sum(bucket_count) AS bucket_count_all 
| eval bucket_count = round(bucket_count_all / 1000 / 1000,2)."M" 
| eval replication_factor = 
    [| rest splunk_server=local /services/cluster/config 
    | return $replication_factor ] 
| eval unique = round(bucket_count_all / replication_factor / 1000 / 1000,2)."M" 
| fields bucket_count unique 
| rename bucket_count AS "Total Buckets", unique AS "Unique Buckets"

View solution in original post

davidpaper
Contributor

On the cluster master, the following search provides answers to both questions.

| rest splunk_server=local /services/cluster/master/peers 
| stats sum(bucket_count) AS bucket_count_all 
| eval bucket_count = round(bucket_count_all / 1000 / 1000,2)."M" 
| eval replication_factor = 
    [| rest splunk_server=local /services/cluster/config 
    | return $replication_factor ] 
| eval unique = round(bucket_count_all / replication_factor / 1000 / 1000,2)."M" 
| fields bucket_count unique 
| rename bucket_count AS "Total Buckets", unique AS "Unique Buckets"

twinspop
Influencer

Excellent, thx! 2 follow-ups: 1) Does S2 change this search at all? 2) Which of the numbers is applicable to the 5m bucket suggested limit?

0 Karma

dpaper_splunk
Splunk Employee
Splunk Employee

1) Nope, I did my testing for this on an SmartStore enabled stack.
2) The bucket limits are Splunk version dependent. The 5m bucket limit I'm aware of is from 6.6 -> 7.1 and it's 5M unique buckets, 15M total buckets (with default RF=3). So both values may apply.

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...