Developing for Splunk Enterprise
Highlighted

Building module or controller

Explorer

Hi guys,

I recently started to use Splunk and it is amazing 🙂 I'm consuming documentation as much as possible, but I found a couple things confusing so would be grateful if someone can direct me or explain a couple of things.

I have installation that monitors some things, devices and etc. and I need to add ability user can configure some parameters from UI by providing him some checkboxes, dropdown options and etc. This (let call it 'configuration app') will need to crawl disk, scan some files and do some logic with those files, before 'configuration app' UI is presented to user.

Now, confusing part to me is how to do it: like module (.conf, .js, .py) or like controller? I'm coming from Rails/Django world so naturally I took controller path and added a couple of templates, but I'm able to run it (I called it 'TestApp.py' and put endpoint as 'testapp').

Then I created a test module, just to get feeling about it; I named it 'TestWidget' and created TestWidget.conf, TestWidget.js and TestWidget.py (nothing fancy: .js part only appends some text on 'renderResults' and .py part just returns some json content). Now, in sample view I just appended '<module name="TestWidget" layoutPanel="navigationHeader"/>' and Splunk (after restart) is reporting: Splunk encountered the following unknown module: "TimeWidget".

Any idea about this? Also, is it possible Splunk to print all available routes or is there any method to figure out this?

Thanks

0 Karma
Highlighted

Re: Building module or controller

SplunkTrust
SplunkTrust

It sounds like you should take a look at how the *nix app was built, it supports such a checkbox-driven configuration.

Highlighted

Re: Building module or controller

Champion

I highly recommend taking a look at dev.splunk.com. Here are a couple of useful links:

If you are creating a controller, you may want to look at the /paths endpoint (http://127.0.0.1:8000/en-US/paths) which provides a list of the registered paths (similar to the /modules endpoint [http://127.0.0.1:8000/en-US/modules]).

View solution in original post

Highlighted

Re: Building module or controller

Explorer

Thank you! Also '/paths' url is something I was looking for some time.

0 Karma
Highlighted

Re: Building module or controller

Explorer

Thanks! I'll check it.

0 Karma