Getting Data In

List of sourcetypes with no data for past 7 days

atreece
Path Finder

I have a bunch of logs from a program that regularly updates local files with changes in network files, and I would like to find out which computers haven't received an update in the past 7 days.
The fields I am using to differentiate the computers is source and sourcetype.

However, the only way to tell if no files have been updated is if there are no events logged in splunk.

Is there an feasible way to denote this? I need a list of all of the sources/sourcetypes which haven't had any events in the past 7 days.

Tags (2)
0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

Using metadata is a great tool for this question. This search will return any sourcetype that hasn't reported a "lastTime" before (now - 7 days of seconds ago).

|metadata type=sourcetypes|eval sevenDaysAgo = now() - (7*24*3600)|where lastTime < sevenDaysAgo

Same thing for sources

|metadata type=sources|eval sevenDaysAgo = now() - (7*24*3600)|where lastTime < sevenDaysAgo

View solution in original post

alacercogitatus
SplunkTrust
SplunkTrust

Using metadata is a great tool for this question. This search will return any sourcetype that hasn't reported a "lastTime" before (now - 7 days of seconds ago).

|metadata type=sourcetypes|eval sevenDaysAgo = now() - (7*24*3600)|where lastTime < sevenDaysAgo

Same thing for sources

|metadata type=sources|eval sevenDaysAgo = now() - (7*24*3600)|where lastTime < sevenDaysAgo

atreece
Path Finder

Thanks! That's giving me exactly the data I need.

0 Karma

MHibbin
Influencer

ahh beat me to it! Up-voted

Get Updates on the Splunk Community!

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...