Getting Data In

Discard long messages?

BogeyMan
Loves-to-Learn Lots

I have an errant application that is sending too much data to my Splunk Enterprise instance.

This is causing licensing overage(s) & warnings.

Until I can fix all the occurrences of this application, I need to configure Splunk to just drop these oversized entries.

I don't want to reject/truncate all messages, just anything over say, 512k.

My understanding is I can do with updates to transform.conf & props.conf?

Here's my transforms.conf:

 

[drop_unwanted_logs]
REGEX = (DEBUG|healthcheck|keepalive)  # Drop logs containing these terms
DEST_KEY = queue
FORMAT = nullQueue

[drop_large_events]
REGEX = ^.{524288,}  # Matches any log >= 512 KB
DEST_KEY = queue
FORMAT = nullQueue

 

 

Ideally, I want this to focus on two of my HEC's, so I updated props.conf:

 

[source::http:event collector 1]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

[source::http:event collector 2]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

[sourcetype::http:event collector 1]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

[sourcetype::http:event collector 2]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

 

 

Am I heading in the right direction? Or, will the following apply to all HEC's?

 

[sourcetype::httpevent]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

 

 

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @BogeyMan 

I guess the main question is, do you want to drop data > 512k, or just truncate it?

If you want to truncate then your TRUNCATE = <n> values should work to truncate to 512k.

Your logic for drop_unwanted_logs also looks good. 

I know it might be pseudo-code, for the props.conf, you dont need to specify sourcetype::<yourSourcetype>, its just [<yourSourcetype>]

[source::http:event collector 1]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

[source::http:event collector 2]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

[sourcetype1]
TRANSFORMS-null=drop_large_events
TRUNCATE = 524288

[sourcetype2]
TRANSFORMS-null=drop_unwanted_logs
TRUNCATE = 524288

Please let me know how you get on and consider accepting this answer or adding karma this answer if it has helped.
Regards

Will

0 Karma

BogeyMan
Loves-to-Learn Lots

Right now, just looking to drop/discard data > 512k.

If I can get this working, we may refine.

Now, when you refer to "sourcetype", is that "httpevent" (to refer to all defined HECs), or, is that the name of the defined event collector (in my example "event collector 1"?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...