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!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...