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
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...