All Apps and Add-ons

Splunk DB Connect: Is it possible to use dbxquery results as a variable for local data search?

New Member

Is it possible to use the results of a dbxquery to be used as a variable for a local search. For example, I want to output data on an hour basis using Splunk DB Connect, but in order to make sure that I am not missing any events that may have occured between data extracts, I want to query my oracle table for the max event time and use that as my "earliest" time. Is this possible?

0 Karma

Splunk Employee
Splunk Employee

@lasonyadj - Did the answer provided by woodcock help provide a working solution to your question? If yes, please don't forget to resolve this post by clicking "Accept". If no, please leave a comment with more feedback. Thanks!

0 Karma

Esteemed Legend

Yes, here is a run-anywhere example (try it for All time and notice that it does it only for an hour):

[| makeresults 
| rename _time AS earliest 
| eval earliest=earliest-3600, latest=now() 
| format "" "" "" "" "" "" 
| rex field=search mode=sed "s/\"//g"]

Yours would just switch out makeresults for your dbxquery command and get rid of the earliest=earliest-3600,.

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 ...