Getting Data In

How can I get oldest event per host from metadata

a212830
Champion

Hi,

Is there a way to get the oldest event dates for certain hosts using metadata?

Tags (2)
0 Karma

MuS
SplunkTrust
SplunkTrust

Hi a212830,

from the docs http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Metadata

firstTime is the timestamp for the first time that the indexer saw an event from this host.

Does this not do the job for you? For me it works:

alt text

somesoni2
Revered Legend

The metadata command doesn't provide you mapping of index/sourcetype and host at once. Try following (will take more time but may be the only option)

| metasearch index=* sourcetype=* host=* | stats min(_time) as firstTime by index sourcetype host
0 Karma

a212830
Champion

Sorry - actually needs to include host, index and sourcetype. I get a lot of data for these hosts, so using metadata would be a hug help. We are concerned that data is dropping.

0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

 Ready to master Kubernetes and cloud monitoring like the pros? Join Splunk’s Growth Engineering team for an ...

Update Your SOAR Apps for Python 3.13: What Community Developers Need to Know

To Community SOAR App Developers - we're reaching out with an important update regarding Python 3.9's ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...