Splunk Search

limiting the scope of index=* in a metadata search

wrangler2x
Motivator

I am using this search:

| metadata index=* type=hosts | eval age = now()-lastTime | where age > (2*86400) | sort age d | convert ctime(lastTime) | fields age,host,lastTime

which works great in showing me systems that have not forwarded anything in two days. However, one of my co-workers is playing around with a temp_index into which he is importing data from another splunk instance from which he exported some old logs. This index has hosts in it which are no longer forwarders, and I thought that perhaps I could add after index=* NOT index=temp_index -- but, alas, this does not work. I could, I suppose list all of the indexes I want but then I'd have to change the saved search every time I add a new index, which I will be doing over the next few months. Seems like there should be a way to do this. Anyone know how?

Tags (1)
0 Karma

fk319
Builder

is there another regex that you can use?


index="hosts*"

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...