Splunk Search

latest

vinod0313
Explorer

Hello

I have below logs in last 60 mins

log1: ABC=1,DEF=2,GHI=3

log2:ABC=0,DEF=0,GHI=3


while executing my query for last 60 mins

i am getting below result

ABC=1,DEF=2,GHI=3
ABC=0,DEF=0,GHI=0

But i want only latest log result as like below

ABC=1,DEF=2,GHI=3

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
...
| head 1
0 Karma

vinod0313
Explorer

could any please help me to find the solution.


0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try limiting the number of events with head

index="cx_aws" source="notification-service"
| head 1
| spath ...

I am not sure if this is the right query but it seems to be the one from your image. The point is that head will reduce the number of events from the base search, in this case to 1 i.e. the latest event

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Check out the dedup command.

---
If this reply helps you, Karma would be appreciated.
0 Karma

vinod0313
Explorer

where should i use this command

0 Karma

richgalloway
SplunkTrust
SplunkTrust
Put it at the end of your current search.
---
If this reply helps you, Karma would be appreciated.
0 Karma

vinod0313
Explorer

I kept dedup command at the end but it didnt worked

vinod0313_0-1598415435724.png

 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...