Splunk Search

Is there a way of comparing current stats against previous periods?

raoul
Path Finder

I would like to be able to compare current levels of activity against that occurring in previous periods.

So, for example, compare the transaction counts "right now" against the same day-of-week and hour-of-day for the preceding week(s).

Tags (1)
1 Solution

MuS
Legend

Hi raoul

if you have the *nix app active for example, you could fire this search and it will give you a list of TCPSessions per hostname:port compared to each other over the last 48h:

source=netstat earliest=-48h@h | multikv | search State=Established | rename LocalAddress AS Host&Port | chart count AS TCPSession by Host&Port | sort limit=10 - TCPSession | streamstats count AS RankA | append [ search source=netstat earliest=-2h@h | multikv | search State=Established | rename LocalAddress AS Host&Port | chart count AS TCPSession by Host&Port | sort limit=10 - TCPSession | streamstats count AS RankB ] | stats first(RankA) AS RankM first(RankB) AS RankD by Host&Port | eval Moved = RankM - RankD | fields Host&Port RankM RankD Moved

this should help you to figure out how it can be done 😉

View solution in original post

MuS
Legend

Hi raoul

if you have the *nix app active for example, you could fire this search and it will give you a list of TCPSessions per hostname:port compared to each other over the last 48h:

source=netstat earliest=-48h@h | multikv | search State=Established | rename LocalAddress AS Host&Port | chart count AS TCPSession by Host&Port | sort limit=10 - TCPSession | streamstats count AS RankA | append [ search source=netstat earliest=-2h@h | multikv | search State=Established | rename LocalAddress AS Host&Port | chart count AS TCPSession by Host&Port | sort limit=10 - TCPSession | streamstats count AS RankB ] | stats first(RankA) AS RankM first(RankB) AS RankD by Host&Port | eval Moved = RankM - RankD | fields Host&Port RankM RankD Moved

this should help you to figure out how it can be done 😉

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...