Splunk Search

Transaction without endswith

martinhelgegren
Explorer

Hi! Filtering data from an amount of hosts looking for downtime durations. I get a "forensic" use view with this search string:

index=myindex host=* | rex "to state\s(?<mystate>.*)" | search mystate="DOWN " OR mystate="UP | transaction by host startswith=mystate="DOWN " endswith=mystate="*UP " | table host,duration,_time | sort by duration | reverse

...where I REX for the specific patterns of "to state " (host transition into another state, in this example "DOWN" or "UP"), I had do do another "search" to get only the specific ones as there are more than DOWN/UP states (due to my anonymization of the data). I then can retrieve the duration between transitions using "duration" and sorting it as I please.

My question - if I'd like to look into ongoing, "at-this-moment-active" hosts in state "DOWN" ie. replace "endswith" with a nominal time value ("NOW"). Where there yet has not been any "endswith" match, just counting the duration from "startswith" to the present moment - any tips on how I can formulate that properly?

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Have a look at the transaction command option e.g. keeporphans and keepevicted to see if they will give what you need

https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transaction

 

0 Karma

martinhelgegren
Explorer

Unfortunately no, tested them both - separately with each boolean value  and together with both true/true, true/false, false/true and false/false. Does not seem to provide the matching needed.

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