Getting Data In

Search query does not return any values

pratapa
Explorer

User complains that the following query is not returning any values in Splunk. 

dbquery wmsewprd  "select REC_TYPE, CODE_TYPE, CODE_DESC, SHORT_DESC, USER_ID from SYS_CODE_TYPE"

0 events

Time range picker : All time 

 

when he runs the same query at database end it is returning results.

Following is the query he is running on database.

select REC_TYPE, CODE_TYPE, CODE_DESC, SHORT_DESC, USER_ID from wmsew.SYS_CODE_TYPE;

 

Why it is not returning any results when we run in splunk.

 

 

 

Labels (1)
0 Karma

anilchaithu
Builder

@pratapa 

If the users are trying the SPL you shared here, then The syntax is not correct

Please try this

 

| dbxquery connection="connection_name" query="select REC_TYPE, CODE_TYPE, CODE_DESC, SHORT_DESC, USER_ID from SYS_CODE_TYPE"

 

 

Hope this helps

0 Karma

pratapa
Explorer

This worked.

dbquery wmsewprd  "select REC_TYPE, CODE_TYPE, CODE_DESC, SHORT_DESC, USER_ID from SYS_CODE_TYPE"

 

We created database connection under setting->External Databases and after that restarted splunk on the host.

When we tried the below query, it worked.

 

dbquery wmsewprd  "select REC_TYPE, CODE_TYPE, CODE_DESC, SHORT_DESC, USER_ID from SYS_CODE_TYPE"

 

This issue is resolved.

0 Karma
Get Updates on the Splunk Community!

2024 Splunk Career Impact Survey | Earn a $20 gift card for participating!

Hear ye, hear ye! The time has come again for Splunk's annual Career Impact Survey!  We need your help by ...

Optimize Cloud Monitoring

  TECH TALKS Optimize Cloud Monitoring Tuesday, August 13, 2024  |  11:00AM–12:00PM PST   Register to ...

What's New in Splunk Cloud Platform 9.2.2403?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2403! Analysts can ...