Splunk Search

Splunk DBConnect use the SQL WITH statement

robjackson
Path Finder

Can Splunk DBConnect use the SQL WITH statement?

 

WITH TABLE_BASE AS (
-- this section is the base query and matches the Smart reporting logic

SELECT DISTINCT

The WITH command is not highlighted in red as the other commands.

 

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@robjackson - Yes you can write the queries with WITH statement.

Color highlighting - It is just that DB Connect is not as smart about SQL queries as Splunk to SPL queries but because DB Connect uses JDBC connector if you have the right drivers installed it should be able to run any correct SQL query.

(I even had a scenario where DB connect was not allowing me to save a SQL query from the inputs page, but I was able to configure the same query from the db_inputs.conf file from the backend.)

So, yes it should run any correct SQL query.

 

I hope this helps!!!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

Ready to make your IT operations smarter and more efficient? Discover how to automate Splunk alerts with Red ...