Splunk Enterprise

How can I adjust the query to include total connections that are initiated out of the country?

Network506
Observer

Good Morning,

I have a query that I'd like to refine. I'm new to Splunk.

So the current query that I'm running is used to identify when people outside of the country connect to our VPN.

index=company_logs "Client Type: Cisco AnyConnect VPN Agent" | iplocation src | stats dc(src) by Country

So this works fine for giving us a tally as to how many total connections are initiated out of the country.

I'd like to get more granular and have a breakdown by username. This is the field that contains the username: Cisco_ASA_user.

How can I adjust the query to include that data?

Thanks!

Labels (2)
0 Karma

woodcock
Esteemed Legend

index=company_logs "Client Type: Cisco AnyConnect VPN Agent"
| stats count src Cisco_ASA_user
| iplocation src
| search NOT Country="United States"
| stats sum(count) AS count dc(src) AS dc_src BY Country user
| stats list(*) AS * BY user

0 Karma

Network506
Observer

Thanks. The first query works great. May I ask another question? How would I modify it to exclude the USA in the results?

0 Karma

johnhuang
Motivator

Add this after the ip location line:

| search NOT Country="United States"


If want to exclude a list of Countries:

 

| search NOT Country IN ("United States", "United Kingdom", "France")
0 Karma

johnhuang
Motivator

There's a few ways to break it down by users. You can try:

 

index=company_logs "Client Type: Cisco AnyConnect VPN Agent" 
| iplocation src 
| stats dc(src) BY Country Cisco_ASA_user

index=company_logs "Client Type: Cisco AnyConnect VPN Agent" 
| iplocation src 
| chart dc(src) BY Cisco_ASA_user Country 

index=company_logs "Client Type: Cisco AnyConnect VPN Agent" 
| iplocation src 
| stats dc(src) values(Cisco_ASA_user) AS Cisco_ASA_user BY Country 

 

 

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...