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 clusterstats
SHA256 checksum (clusterstats_10.tgz) 3c7c6da950dc878334cdd087e289fe2ca45957ee58a9d72f08e4c51f3d5c7365
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

clusterstats

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
clusterstats is an external python search command which gives statistics about clusters or groups of slow transactions which take place in a maximum span of seconds.

clusterstats v1.0 by Sean Foley, tested on Splunk 6.1.2

clusterstats is an external python search command packaged as an add-on for
Splunk.

I wrote clusterstats to give stats about clusters of anomalous (slow)
transactions. The search I was working with used transaction to tie related
events into a transaction and add the duration field. I then piped the results
into a command to filter out the normal transactions and leave the slow ones:

| search duration > 3

The command expects to be passed a maxspansecs=X argument and it expects to be
piped events which contain _time and duration fields, and it expects the results
to be in reverse order since it needs to process in time order to calculate the
start of a cluster, the end of a cluster, the number of transactions in the
cluster, the max and mean duration for the cluster. Keep in mind that the max is
probably accurate but the mean is only averaging the duration from the filtered events so it is the mean duration for the cluster of events > than 3 seconds if the above filtering search is used.

The command returns a new set of events to splunk web which represent timings
and statistics from each cluster identified in the original set of events as
determined by the maxspansecs window. The following fields are returned:

_time : the start time of the cluster

cluster_end_time : the calculated end time of the event based on the latest
transaction end time (transaction start + duration).
cluster_max_duration : the highest duration value from cluster transactions

cluster_mean_duration : the mean of the duration values for the cluster

As a starting point I use the following to nicely format the epoch times and float values after my base search, the transaction command, and the search duration filter above:

| clusterstats maxspansecs=30
| convert timeformat="%m/%d/%Y %H:%M:%S" ctime(cluster_end_time)
as cluster_end_time
| convert timeformat="%m/%d/%Y %H:%M:%S" ctime(cluster_last_txn_start)
as cluster_last_txn_start
| table _time cluster_end_time cluster_txn_count cluster_max_duration
cluster_mean_duration
| eval cluster_max_duration=round(cluster_max_duration,2)
| eval cluster_mean_duration=round(cluster_mean_duration,2)
| rename _time as cluster_start_time
|convert timeformat="%m/%d/%Y %H:%M:%S" ctime(cluster_start_time)
as cluster_start_time

This should get you going.

Release Notes

Version 1.0
Sept. 18, 2014

Initial release.


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.