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.

 

Labels (1)
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
Get Updates on the Splunk Community!

How to Get Started with Splunk Data Management Pipeline Builders (Edge Processor & ...

If you want to gain full control over your growing data volumes, check out Splunk’s Data Management pipeline ...

Out of the Box to Up And Running - Streamlined Observability for Your Cloud ...

  Tech Talk Streamlined Observability for Your Cloud Environment Register    Out of the Box to Up And Running ...

Splunk Smartness with Brandon Sternfield | Episode 3

Hello and welcome to another episode of "Splunk Smartness," the interview series where we explore the power of ...