Getting Data In

Can I configure Heavy Forwards to Reject *Events* older than a certain age?

briancronrath
Contributor

I should clarify I am not talking about the "ignoreOlderThan" setting which by my understanding only looks at the file date, what I'm interested in here is ignoring events themselves that are older than a certain date.  We have a lot of events come in through methods other than file ingestion, and a lot of the time we get events that are older than the configured retention age on an index, which cause early eviction of other events lumped into the bucket.  I'm looking for a way if possible, to look at events on the heavy forwarders and reject them if they are older than a certain age, ideally per index if possible as well.

Labels (2)
0 Karma
1 Solution

woodcock
Esteemed Legend

props.conf:

# For now, do it for ALL sourcetypes.
[(::)?...]
TRANSFORMS-oldevents=delete-older-than-January-1-2022

transforms.conf:

[delete-older-than-January-1-2021]
# 01 Jan 2021 01:01:01 GMT = 1609462861
INGEST_EVAL = queue=if(substr(tostring(1609462861-_time),1,1)=”-“, “indexQueue”, “nullQueue”)

[delete-older-than-January-1-2022]
# 01 Jan 2022 01:01:01 GMT = 1640998861
INGEST_EVAL = queue=if(substr(tostring(1640998861-_time),1,1)=”-“, “indexQueue”, “nullQueue”)

[delete-older-than-January-1-2023]
# 01 Jan 2023 01:01:01 GMT = 1672534861
INGEST_EVAL = queue=if(substr(tostring(1672534861-_time),1,1)=”-“, “indexQueue”, “nullQueue”)

View solution in original post

woodcock
Esteemed Legend

props.conf:

# For now, do it for ALL sourcetypes.
[(::)?...]
TRANSFORMS-oldevents=delete-older-than-January-1-2022

transforms.conf:

[delete-older-than-January-1-2021]
# 01 Jan 2021 01:01:01 GMT = 1609462861
INGEST_EVAL = queue=if(substr(tostring(1609462861-_time),1,1)=”-“, “indexQueue”, “nullQueue”)

[delete-older-than-January-1-2022]
# 01 Jan 2022 01:01:01 GMT = 1640998861
INGEST_EVAL = queue=if(substr(tostring(1640998861-_time),1,1)=”-“, “indexQueue”, “nullQueue”)

[delete-older-than-January-1-2023]
# 01 Jan 2023 01:01:01 GMT = 1672534861
INGEST_EVAL = queue=if(substr(tostring(1672534861-_time),1,1)=”-“, “indexQueue”, “nullQueue”)

briancronrath
Contributor

Awesome thank you so much!  I modified it a bit to use a relative time check:

INGEST_EVAL = queue=if(substr(tostring(relative_time(now(),"-10d")-_time),1,1)="-", "indexQueue", "nullQueue")
0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...