Splunk Search

How to get the min, average, max, median event size, standard deviation of event size by sourcetype

harishsplunk7
Explorer

How to Inspect each feed by different criteria:


Average ingestion rate per day, Minimum event size, 24 hour period
Average event size, 24 hour period, Maximum event size, 24 hour period, Median event size, 24 hour period
Standard Deviation of event size, 24 hour period based on sourcetype or source

Labels (6)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Most of those can be collected with three commands.  The rest depends on what is meant by "average ingestion rate" (what is being averaged over what period).

<<your search>>
| bin span=24h
| eval size=len(_raw)
| stats min(size) as MinEventSize, avg(size) as AvgEventSize, max(size) MaxEventSize, median(size) as MedianEventSize, stdev(size) as StdevEventSize by _time,sourcetype

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Most of those can be collected with three commands.  The rest depends on what is meant by "average ingestion rate" (what is being averaged over what period).

<<your search>>
| bin span=24h
| eval size=len(_raw)
| stats min(size) as MinEventSize, avg(size) as AvgEventSize, max(size) MaxEventSize, median(size) as MedianEventSize, stdev(size) as StdevEventSize by _time,sourcetype

 

---
If this reply helps you, Karma would be appreciated.

harishsplunk7
Explorer

When I look at the average and max size of the events, I see that the Max event size sometimes is exactly 300,000 bytes, which is suspicious. Please let me know did the event fields change ? if we receiving 10 events in one chunk of 300,000 bytes ?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

It could be the events are being truncated.  Check the TRUNCATE setting in the relevant props.conf stanza.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...