Splunk Search

How to use streamstats to evaluate events from different sourcetypes?

bhavlik
Path Finder

Background:  I'm trying to create a monthly report that tracks how many terminals we Add and how many terminals we Remove at a property.  We have two separate events that track these:  RoomTerminalAdd and RoomTerminalRemove.  

Sometimes we have field reps that need to troubleshoot these terminals and end up with multiples of these events that don't actually indicate a full Add or Remove.  I would like to "pair up" these events and evaluate the time differences based on the property, room number, and terminal address.  If the time difference is below 15 minutes then I want to removed them from the final monthly count.  

Here's a visual to help explain what I'm trying to do:

bhavlik_0-1592261741653.png

After removing these "pairs" that fit the <15 min time difference, I want to then get a total count of each event type separately.   TerminalsAdded=##  TerminalsRemoved=##

I have used the command transaction in the past but won't work here as it removes any events that don't have a pair and I need to keep those for my overall count.  My next option would be streamstats but I don't have any experience with using that command and not sure how to bring in the time difference for evaluating what to keep and what to remove from search.  

Anyone out there have any advice or tips on how to reach my end goal?

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...