Refine your search:

For my app i have my own .conf file. The app is the webmonitor app that will on a schedule iterate through a list of urls and time the request, check size, crc contents, etc..

I'd like to reuse the manager or setup.conf system be able to let users add/delete/edit a URL - which is just a stanza in my own conf. Is there a mechanism to hook into manager or via setup.conf let me manage a list of stanza's? I want to reuse the UI for managing file inputs but not manipulate my conf/stanzas.

Thanks in advance! e

asked 10 Dec '10, 19:44

Erik%20Swan's gravatar image

Erik Swan ♦
864214
accept rate: 33%

edited 10 Dec '10, 19:49

ftk's gravatar image

ftk ♦
6.2k419


One Answer:

I don't think you can hook directly into the manager. However, it sounds like you can try the setup route. After you create setup you can access it via Manager > App and next to your app, there will be setup link.

Have you taken a look at this:
http://www.splunk.com/wiki/Create_a_setup_screen_to_modify_conf_files

It sounds like what you're looking for. You'll need to make a setup.xml for your app. The limitation as mentioned on that page is "The .conf files and stanza(s) you want to modify must already exist."

If you're looking at more flexibility (dynamically create a stanza) take a look here:
http://www.splunk.com/wiki/Create_setup_screen_using_a_custom_endpoint

You will need to write your own endpoint. But you'll have control over specifying the stanza (whether update or create), and key/values that go under that stanza.

Take note:

def handleEdit(self, confInfo):
      ...
      self.writeConf('myappsetup', 'setupentity', self.callerArgs.data)

The parameters to writeConf():
'myappsetup' ==> filename of the .conf you want to write, inputs.conf would be 'inputs'
'setupentity' ==> the stanza name, i.e. 'script://./bin/myScript.sh'
self.callerArgs.data ==> the key/values you want for the stanza.

callerArgs.data is an associative array like so:
{"disabled":0, "interval":60}

It's likely those values won't be static, so you'd need some additional logic to grab those values from setup.xml

link

answered 03 Feb '11, 21:54

dleung's gravatar image

dleung ♦
986
accept rate: 11%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×207

Asked: 10 Dec '10, 19:44

Seen: 1,142 times

Last updated: 02 Apr '11, 15:22

Copyright © 2005-2012 Splunk, Inc. All rights reserved.