Just for the fun of it, I ran all searches as run everywhere examples with fixed time range and leave you to choose the fastest/best for your use case:
index=_internal earliest=-2d@d latest=-1d@d | dedup sourcetype | table sourcetype
This search has completed and has returned 8 results by scanning 2,907,591 events in 249.892 seconds.
index=_internal earliest=-2d@d latest=-1d@d | stats dc(sourcetype) by sourcetype
This search has completed and has returned 8 results by scanning 2,907,591 events in 229.72 seconds.
index=_internal earliest=-2d@d latest=-1d@d | stats latest(sourcetype) by sourcetype
This search has completed and has returned 8 results by scanning 2,907,591 events in 228.705 seconds.
index=_internal earliest=-2d@d latest=-1d@d | table sourcetype | stats latest(*) as * by sourcetype
This search has completed and has returned 8 results by scanning 2,907,591 events in 382.519 seconds.
index=_internal earliest=-2d@d latest=-1d@d | table sourcetype | stats values(sourcetype)
This search has completed and has returned 1 result by scanning 2,907,591 events in 388.672 seconds.
cheers, MuS
... View more