Splunk Search

How DBX decides dbmon interval

melonman
Motivator

Hello,

I am using DB Connect to pull data from my DB.
I had configured dbmon interval manually (interval = 30s, for example).
However, DBX can adjust interval automatically. (interval = auto)

My question is, how DBX is deciding and adjusting the interval for dbmon.

Could anyone comment and hopefully provide information in detail?

Thank you!

0 Karma

phoenixdigital
Builder

Super late response but I thought I would post the answer as I was looking for the exact same information.

The only answer I could find was

auto - The scheduler automatically chooses an interval based on the number of generated results.

Ref: http://docs.splunk.com/Documentation/DBX/1.2.0/DeployDBX/inputsspec

I had a dig through the DatamaseMonitor.class in the dbx.jar which lead me to Scheduler.class which led me to this function which determines the time

    private long getAutoDelay(DbmonResult result) {
        if (result.getResultCount() == 0) {
            long lastDelay = result.getMonitorDefintion().getLastDelay();
            if (lastDelay != -1) {
                return Math.max(this.autoMinDelay, Math.min(lastDelay + this.autoDecayIncrement, this.autoMaxDelay));
            }
            return this.autoMaxDelay;
        }
        return Math.min(Math.max(this.autoMinDelay, result.getDuration() / (long)result.getResultCount() * (long)this.autoDurationFactor), this.autoMaxDelay);
    }

this.autoMinDelay defaults to 5000
this.autoMaxDelay defaults to 5000
this.autoDecayIncrement defaults to 5000
this.autoDurationFactor defaults to 100

So it appears to be related to the number of factors such as

  • Number of results returned
  • How long the last delay was between queries
  • How long the search took to run

So for a search that returned zero results the delay appears to be every 5000ms
For a search with more than zero results it is based on this function

return Math.min(Math.max(this.autoMinDelay, result.getDuration() / (long)result.getResultCount() * (long)this.autoDurationFactor), this.autoMaxDelay);

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...