Splunk Search

How to use streamstats to evaluate events from different sourcetypes?

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:


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!

Data Preparation Made Easy: SPL2 for Edge Processor

By now, you may have heard the exciting news that Edge Processor, the easy-to-use Splunk data preparation tool ...

Introducing Edge Processor: Next Gen Data Transformation

We get it - not only can it take a lot of time, money and resources to get data into Splunk, but it also takes ...

Tips & Tricks When Using Ingest Actions

Tune in to learn about:Large scale architecture when using Ingest ActionsRegEx performance considerations ...