Splunk Search

How to edit my search to find the last seen date of our computers?

jmcaloon
Explorer

What I am trying to do is currently search for Computers that were last seen 10 days or more ago. Currently right now I have the following search syntax:

ComputerName=* AgentVersion=* | dedup ComputerName| table timestamp ComputerName, AgentVersion.

Do I need an eval and then last seen time? If so how would I do that?

Thank you,
Jack McAloon

0 Karma

woodcock
Esteemed Legend

What you have done should work if you change timestamp to _time:

 ComputerName=* AgentVersion=* | dedup ComputerName | table _time ComputerName AgentVersion

But this is more efficient:

| metadata type=hosts | rename lastTime AS _time | fields _time host

But it does not give you the other details that you need.
BTW, you should ALWAYS specify index="SomeIndexHere" sourcetype="SomeSourcetypeHere" in your searches.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...