Splunk Dev

Building module or controller

dig666
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
1 Solution

LukeMurphey
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

dig666
Explorer

Thanks! I'll check it.

0 Karma

LukeMurphey
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]).

dig666
Explorer

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

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

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

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...