Splunk Search

Compare results from same field

CyberWolf
Explorer

I'm using cmd |iplocation src, and the results produce results for the City. Next i want to compare each City and report when results is different.

Example when result for a City is Miami and next hour or so  in the same field for the City is Boston.

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| streamstats latest(city) as previous current=f

View solution in original post

CyberWolf
Explorer

Thanks Everyone for fast response!

gcusello
SplunkTrust
SplunkTrust

Hi @CyberWolf ,

I suppose that you want to check this for each Account_name, you could try with stats:

<your_search>
| iplocation src
| stats dc(city) AS city_count BY Account_name
| where city_count>1

use the Account_name field you have in your logs.

Ciao.

Giuseppe

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| streamstats latest(city) as previous current=f

CyberWolf
Explorer

It worked! thank you!

richgalloway
SplunkTrust
SplunkTrust

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...