Splunk Search

How to search only sourcetypes that began ingestion in last 7 days

sdewar83
Path Finder

Hi,

I'm very much a Splunk novice, but I've been playing around with trying to do some health checks for Splunk so when we configure new forwarders etc we can tell whether the sourcetype is being ingested.

I had the date picker on 7 days came up with:

|metadata type=sourcetypes | convert ctime(firstTime) | Fields - type, totalCount, recentTime, lastTime

This seems to give me the first time within the last 7 days that all sourcetypes were ingested.

I was hoping someone could help me with the logic to make this only show sourcetypes whose first began ingesting in the last 7 days?

Cheers

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@sdewar83 ,

Try

| metadata type=sourcetypes  where firstTime>=relative_time(now(),"-7d@d")
Happy Splunking!
0 Karma

sdewar83
Path Finder

This certainly gives me a result ... but it still gives me results of other sourcetypes whose first time wasn't less than 7 days ago? I would've thought that it'd return nothing, unless i'd introduced a new sourcetype in the last 7 days, if that makes sense.

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud | Customer Survey!

If you use Splunk Observability Cloud, we invite you to share your valuable insights with us through a brief ...

Happy CX Day, Splunk Community!

Happy CX Day, Splunk Community! CX stands for Customer Experience, and today, October 3rd, is CX Day — a ...

.conf23 | Get Your Cybersecurity Defense Analyst Certification in Vegas

We’re excited to announce a new Splunk certification exam being released at .conf23! If you’re going to Las ...