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
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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...