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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...