Alerting

When does metadata age out?

kearaspoor
SplunkTrust
SplunkTrust

I have a search that is looking through the metadata for high-priority/hig-volume hosts and it sucessfully alerts us if one of them hasn't sent in events in the previous 15 minutes.

| metadata type=hosts | search host=****| fields host, lastTime, recentTime | eval LastTime=strftime(lastTime, "%m-%d-%Y %H:%M:%S") | eval RecentTime=strftime(recentTime, "%m-%d-%Y %H:%M:%S") | eval dif=(now()-recentTime) | where dif>900 | rename dif AS eventLastRecieved_SecondsAgo | fields host RecentTime eventLastRecieved_SecondsAgo

The problem started showing up when one of these hosts was recently replaced and a rename occurred. For a short period of time, a server with a temporary name that matches the convention above was seen sending logs, as expected. When that server was renamed to the original server's name we started receiving alerts that the temporary name was no longer sending logs, as we'd expect. The problem is that we're still receiving those alerts several days later.

I've tried adjusting the timespan of the metadata search to only look at the metadata in the previous couple hours but the temporary hostname is still showing up.

So... How does metadata age? Will this host ever stop showing up? Or should I re-work the alert to show events where the last event was older than 15 minutes but less than X days?

Tags (3)
0 Karma
1 Solution

emiller42
Motivator

metadata age is directly tied to index age. When you run the metadata command you're basically looking at the indexed metadata pulled by splunk.

So if the old host name shows up in any index bucket, it'll show up in the metadata search. When you narrow the time range, it will return results from any index bucket that has an event within the specified time range. Again, if the old host is in any of those buckets, it'll return in the search.

So it'll eventually age, but the speed of that depends on your indexing volume and bucket sizing.

View solution in original post

emiller42
Motivator

metadata age is directly tied to index age. When you run the metadata command you're basically looking at the indexed metadata pulled by splunk.

So if the old host name shows up in any index bucket, it'll show up in the metadata search. When you narrow the time range, it will return results from any index bucket that has an event within the specified time range. Again, if the old host is in any of those buckets, it'll return in the search.

So it'll eventually age, but the speed of that depends on your indexing volume and bucket sizing.

kearaspoor
SplunkTrust
SplunkTrust

I was suspecting something like that. Thanks for clearing it up!

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!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...