I am working on a custom module that extends the SingleValue module. I couldn't get the custom module to work correctly by placing it in the appserver/modules directory so I moved it to the %SPLUNK_HOME%\share\splunk\search_mrsparkle\modules directory. The module is now throwing this error:
Splunk could not find a controller to
import for the following module:
"Splunk.Module.Test".
I created the following files: Test.js, Test.conf, and Test.html. Test.conf is a copy of the SingleValue.conf file. What do I need to change to get Test to extend SingleValue?
Test.js:
//put Module in the namespace if it isnt already there.
Splunk.namespace("Module");
Splunk.Module.Test = $.klass(Splunk.Module.SingleValue, {
});
Test.html
<%page args="module"/>
<div class="SingleValueHolder">
<span class="singleLabel singleLabelBefore"></span>
<span class="singleResult">...</span>
<span class="singleLabel singleLabelAfter"></span>
</div>
Test.conf
[module]
# The JavaScript name of the module
className = Splunk.Module.Test
# The module class to subclass from
superClass = Splunk.Module.SingleValue
description = This module waits for the search to complete and then renders a single field from the first row of the results
[param:beforeLabel]
label = Label to display before the result
required = False
translate = string
default =
[param:afterLabel]
label = Label to display after the result
required = False
translate = string
default =
[param:field]
label = Field to display - Defaults to first field returned
required = False
default =
[param:additionalClass]
label = An optional additional css class name to add to the result container
required = False
default =
[param:classField]
label = Adds the value of the classField of the first result as an additional css class to the result container. Pre-defined classes include 'severe', 'elevated', 'low', and 'None' (default).
required = False
default =
[param:linkSearch]
label = Specify a valid complete search query to turn the result into a clickable link
required = False
default =
[param:linkView]
label = Specify which view to execute the linked search against
required = False
default = dashboard
[param:linkFields]
label = Specify whether to just link the result, or include labels. To link the result and both labels, specify "result,beforeLabel,afterLabel"
required = False
default = result
[param:format]
label = Specifies the data formatting method to apply to the value. Locale aware. Defaults to none.
required = False
values = number,decimal,percent,none
... View more