All Apps and Add-ons

Procedure in Splunk DBConnect 3.1

Aleksey_18
New Member

Hey guys
Tell me how to set the time, which is indicated in the procedure for how much time to show the data ?
For example, I have this procedure in MSSQL

In MSSCL, I address it like this EXEC Staging.[dbo].[mon_GetCountRecentOrdersFailures_App] 1

Where at the end of the procedure is the digit -1. Selection of data from the procedure for the last 1 minute.
How can I make the same request in Splunk ?
I did it like this - | dbxquery connection="Monitor_MSSQL" procedure="{call Staging.[dbo].[mon_GetCountRecentOrdersFailures_App]}"

The request works, but I do not know for what time this data was received.

In the manual (http://docs.splunk.com/Documentation/DBX/3.0.2/DeployDBX/Commands#procedure) there are some parameters "params" that are passed to the called procedure

How to correctly specify this in the request of the SPL using the command dbxquery ?

Tags (1)
0 Karma

kheo_splunk
Splunk Employee
Splunk Employee

Can you try the following syntax?

| dbxquery connection="Monitor_MSSQL" procedure="{call Staging.[dbo].[mon_GetCountRecentOrdersFailures_App](?)}" params="1"

I could not test the above on MS SQL server but I have tested stored procedures on Oracle database in which the first parameter is reserved for output for dbxquery command.

1] Create a stored procedure using the following SQL

CREATE OR REPLACE PROCEDURE dbx(
     p_ref_cursor  OUT SYS_REFCURSOR, 
     id          IN  VARCHAR,
     dep_id      IN  VARCHAR)
AS
BEGIN
  OPEN p_ref_cursor FOR 
    SELECT * FROM  employees WHERE employee_id = id and department_id = dep_id;
END  dbx;

2] Run dbxquery command.

   | dbxquery connection=oracle procedure="{call dbx(?,?,?) }" params="173,81"

This worked for me.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...