Splunk Search

How to create a search with week to week comparison of counts by SrcCountry

will09222
New Member

Hi,

I am new to splunk.

Currently using this query to get the count index=* SrcCountry=* | stats count by SrcCountry. 

If I wanted to narrow down the search to one country and get a week by week comparison of the count what kind of query could I use?

Labels (3)
0 Karma

sperkins
Path Finder

index=* SrcCountry=Mexico 
| timechart span=1week count by SrcCountry 

This gives you a count by Country per week. 

Run the search across 2 weeks. (If you want complete weeks you can "snap down" to the nearest week by using span=1w@w)

Or, 
index=* SrcCountry=Mexico 
| timechart count by SrcCountry span=1d
| timewrap 1week

This returns a daily count by country, that is compared to the previous week days. 

I used Mexico as the example country. Any countries with spaces need quotes: like "United States"

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...