Splunk Enterprise

SQL Query Execution Time

vijayansundarar
New Member

I am hoping to use DB Connect to perform an SQL query and log the execution time? (As i can do in an sql client with set timing on).

If this is a possible use case for Splunnk DB Connect, is there some document on how to achieve this?

Tags (1)
0 Karma

ziegfried
Influencer

DB Connect logs the execution time of the commands by default. You can use the following search for example to see the execution times of dbquery:

index=_internal sourcetype=dbx_debug (logger=DatabaseQueryCommand (action=executing OR "statement executed")) OR (logger=ExecutionContext "Execution finished") 
| eval query_duration=tostring(duration/1000,"duration")
| transaction thread maxpause=30m startswith=(logger=DatabaseQueryCommand action=executing) endswith=(logger=ExecutionContext)
| table _time query database count query_duration
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 ...