Getting Data In

What is the correct syntax to change Database Monitor (dbmon-tail) in setup.xml?

pedromvieira
Communicator

What is the correct syntax to change Database Monitor (dbmon-tail) in setup.xml?

Example:

[dbmon-tail://MY_DB/mydbqueryname]

setup.xml

  <block title="My Database Monitor" endpoint="admin/dbx-monitors" entity="MY_DB%252FMYDBQUERYNAME">
0 Karma
1 Solution

pedromvieira
Communicator

I fixed it with correct URL Encoding.

URL Enconding reference:
http://www.w3schools.com/tags/ref_urlencode.asp

inputs.conf

[dbmon-tail://MYQUERY]
interval = 5
query = SELECT * FROM [MY_TABLE] {{WHERE $rising_column$ > ?}}
disabled = 0

setup.xml

  <block title="MY_DBMON" endpoint="admin/dbx-monitors" entity="dbmon%2Dtail%3A%252F%252FMY_DBQUERY">
    <input field="query">
      <label>Query</label>
      <type>text</type>
    </input>
    <input field="interval">
      <label>Schedule</label>
      <type>text</type>
    </input>    
    <input field="disabled">
      <label>Disabled</label>
      <type>bool</type>
    </input>  
  </block>  

This translates:

dbmon%2Dtail%3A%252F%252FMYDBQUERY

TO

dbmon-tail://MYQUERY

View solution in original post

0 Karma

pedromvieira
Communicator

I fixed it with correct URL Encoding.

URL Enconding reference:
http://www.w3schools.com/tags/ref_urlencode.asp

inputs.conf

[dbmon-tail://MYQUERY]
interval = 5
query = SELECT * FROM [MY_TABLE] {{WHERE $rising_column$ > ?}}
disabled = 0

setup.xml

  <block title="MY_DBMON" endpoint="admin/dbx-monitors" entity="dbmon%2Dtail%3A%252F%252FMY_DBQUERY">
    <input field="query">
      <label>Query</label>
      <type>text</type>
    </input>
    <input field="interval">
      <label>Schedule</label>
      <type>text</type>
    </input>    
    <input field="disabled">
      <label>Disabled</label>
      <type>bool</type>
    </input>  
  </block>  

This translates:

dbmon%2Dtail%3A%252F%252FMYDBQUERY

TO

dbmon-tail://MYQUERY
0 Karma

chanfoli
Builder

dbmon-tail stanzas are normally added to an inputs.conf in $SPLUNK_HOME/etc/apps/dbx/local when you create a tail input in the db connect web interface.

This section of the DBX documentation covers the basic concepts:

http://docs.splunk.com/Documentation/DBX/1.1.6/DeployDBX/Configuredatabasemonitoring#How_dbmon-tail_.... I am not sure I understand what you are trying to do with setup.xml in this context. Does this information help? If not could you elaborate a little more on what you are trying to change?

0 Karma

chanfoli
Builder

Although I do not see it documented specifically for setup.xml, if default values for query is what you are after, enclosing the text in a default element inside the query input might work.

<input field="query">
       <label>Query</label>
       <type>text</type>
       <default>SELECT something FROM something-else</default>
     </input>
0 Karma

pedromvieira
Communicator

I moved my dbmon-tail to my app folder. It's working.
I need to change the query part for each installation, because each can point to a new table and/or customer, that's why I want to do it in setup.xml.

setup.xml

  <block title="My - Database Monitor" endpoint="admin/dbx-monitors" entity="...">
    <input field="query">
      <label>Query</label>
      <type>text</type>
    </input>
    <input field="interval">
      <label>Schedule</label>
      <type>text</type>
    </input>    
    <input field="disabled">
      <label>Disabled</label>
      <type>bool</type>
    </input>  
  </block> 

input.conf

[dbmon-tail://MYQUERY]
interval = 5
query = SELECT * FROM [MY_TABLE] {{WHERE $rising_column$ > ?}}
disabled = 0
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!

Splunk Add-on for Microsoft Windows 11.0.3: Parse Once, Search Faster

The updated Splunk Add-on for Microsoft Windows helps customers search Windows events faster by reducing ...

What's New in Splunk Enterprise Security 8.8 and Beyond

Threats move at machine speed. Keeping up should not depend on having the biggest budget, the largest team, or ...

A Four-Part Event Series: State of Observability - Where AI Meets Performance

As AI agents take on more complex tasks, teams need greater visibility into how they behave, what they cost, ...