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
Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

New Release | Splunk Cloud Platform 10.1.2507

Hello Splunk Community!We are thrilled to announce the General Availability of Splunk Cloud Platform 10.1.2507 ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

&#x1f5e3; You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...