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 (3)
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!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...