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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...