Splunk Search

How can I use transaction as a boolean to create a visualization in a timechart?

bdondlinger
Explorer

I'd like to create a visualization showing the connected state of a hand full of clients.

We log connected state as "ClientID=nnnn - Connected" ... "ClientID=nnnn - Unreachable"

My search is as follows

 index=blah "Connected"  OR "Unreachable" | transaction ClientID startswith="Connected" endswith="Unreachable" | eval durationstr = tostring(duration,"duration") | table ClientID, durationstr, _time

how can I use transactions as a boolean to create a nice visualization showing client connectivity in a timechart?

0 Karma

cmerriman
Super Champion

If I'm understanding you, you'd like any ClientID that has "Connected" to be equal to 1 (for instance) and "Unreachable" to be equal to 0?
You could try something like:

  index=blah "Connected"  OR "Unreachable" | transaction ClientID startswith="Connected" endswith="Unreachable" | eval durationstr = tostring(duration,"duration")|eval ID=if(like(ClientID,"%Connected"),1,0)| table ClientID, durationstr, _time
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...