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!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...