Getting Data In

how - metadata host by index and sourcetype recentTime

robf
Path Finder

This search produces the most recent timestamp for every host for aa specific index

| metadata type=hosts index=windows |
convert ctime(*Time) | table host
index recentTime

how can i break it down a level further by last tinme a host reported in for a given sourcetype and index?

eg

    host   index    sourcetype   recenttime
    host1  windows   system      30/06/2014 04:55
    host1  windows   security    30/06/2014 05:15
0 Karma

somesoni2
Revered Legend

There is no in-build metadata which gives this information grouped by index, sourcetype and host all.

You can try this to get the the timestamp of last written entry for index, sourcetype host combination. This is the fastest available search I believe for this requirement (other than @martin's which is specific to Splunk6).

|metasearch index=clm_transactions sourcetype=* host=* | stats max(_time) as recentTime by index sourcetype host

select appropriate time range for the search so that you can cover most of the host. It won't report for the hosts which have written any entries in given time range.

strive
Influencer

metadata type=hosts doesn't contain sourcetye information.

Check this

http://answers.splunk.com/answers/10005/how-to-get-host-sourcetype-and-source-from-a-single-metadata...

You may need different combinations. This link http://answers.splunk.com/tags/metadata/ has questions tagged with metadata. Some of these may help you.

0 Karma

strive
Influencer

|metasearch index=* sourcetype=* host=* | table index sourcetype host

This wont fetch recentTime

0 Karma

linu1988
Champion

Hello Rob,
If you are on Splunk 6 @martin_mueller 's answer will help you get the info.

http://answers.splunk.com/answers/145995/alert-if-source-stops-indexing

Or

you can maintain a lookup table and make the comparison with metadata.

Thanks,
L

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...