All Apps and Add-ons

Splunk DBConnect Issue Unrecognized option: Date, case when

reverse
Contributor
Unrecognized option: Date, case when trunc(sysdate-aafa.app_recvd_dt) <=4 then 4 days or less when trunc(sysdate-aafa.app_recvd_dt) between 5 and 7 then '5 to 7 days' when trunc(sysdate-aafa.app_recvd_dt) between 8 and 15 then '8 to 15 days' when trunc(sysdate-aafa.app_recvd_dt) between 16 and 21 then '16 to 21 days' when trunc(sysdate-aafa.app_recvd_dt) between 22 and 30 then '22 to 30 days' when trunc(sysdate-aafa.app_recvd_dt) between 31 and 45 then '31 to 45 days' when trunc(sysdate-aafa.app_recvd_dt)>45 then 'More than 45 days' end as span, rtapp.description AS Application

The query is running fine in SQL explorer but not in splunk.

Query...

...
...
...
...
..
...
case when trunc(sysdate-aafa.app_recvd_dt) <=4 then '4 days or less'
when trunc(sysdate-aafa.app_recvd_dt) between 5 and 7 then '5 to 7 days'
when trunc(sysdate-aafa.app_recvd_dt) between 8 and 15 then '8 to 15 days'
when trunc(sysdate-aafa.app_recvd_dt) between 16 and 21 then '16 to 21 days'
when trunc(sysdate-aafa.app_recvd_dt) between 22 and 30 then '22 to 30 days'
when trunc(sysdate-aafa.app_recvd_dt) between 31 and 45 then '31 to 45 days'
when trunc(sysdate-aafa.app_recvd_dt)>45 then 'More than 45 days' end as span,
...
...
..
..
.
.
.
.
.
.
.
Tags (2)
0 Karma
1 Solution

reverse
Contributor

The issue was spaces in aliases. Not at all related to error thrown

View solution in original post

0 Karma

reverse
Contributor

The issue was spaces in aliases. Not at all related to error thrown

0 Karma

maciep
Champion

if you get rid of the case statements, does it run? if not, there's probably something wrong elsewhere causing the issue to show up there? If it does, then maybe try one condition in the case, then the next and so on to see where it's getting upset exactly.

0 Karma

p_gurav
Champion

try using else in case command before end.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...