Splunk Search

How do I find the latest time project name in each group?

flzhang132
Explorer

I want to group by virtual machine and then find the latest time project name in each group. How would I implement this?

thanks!

alt text

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@flzhang132

Have you tried this?

YOUR_SEARCH
| stats latest(project) as project latest(_time) as _time by vm_id

Sample Search:

| makeresults | eval project="erp",vm_id=100,_time=now()-180 | append [| makeresults | eval project="erp",vm_id=100,_time=now()-120] | append [| makeresults | eval project="ems",vm_id=100,_time=now()-60] | append [| makeresults | eval project="mcs",vm_id=101,_time=now()-180] | append [| makeresults | eval project="mcs",vm_id=101,_time=now()-120] | append [| makeresults | eval project="mes",vm_id=101,_time=now()-60] | stats latest(project) as project latest(_time) as _time by vm_id

Thanks

0 Karma

493669
Super Champion

try this:

|stats latest(time) by vm_id project

flzhang132
Explorer

no,no,no ,the result of this way is alt text

I need latest time project name in each group. and there is only one data in each group

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...