Splunk Search

List events from latest log indexed?

bfinney
Engager

I'm looking for help creating a search that returns all events from the last log indexed.
This is what i've tried but it doesnt return the events just the source.

| get all sources from metadata | sort all sources desending by time and only return the last one | join the main index on the source columns

| metadata type=sources | sort 1 recentTime desc
| fields source
| join source [search index=main | fields source]

0 Karma

jonuwz
Influencer

So close ...

* [ | metadata type=sources | sort 1 recentTime desc | fields source ]

The subsearch in the [ .. ] expands to ( source=your_latest_source )

So the main search is

* ( source=your_latest_search )

jonuwz
Influencer

Good to know. For the record, you dont have to send extra rep, accepting the answer is the normal way to do that. Cheers

0 Karma

bfinney
Engager

That fixed it. Thanks!

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...