I'm very new to web development, but I ended up with two really big questions from this effort:
1) Is it possible to call methods of an instantiated module, from within a different module, and execute that instantiated module's methods using jquery?
2) Is there a way to do this using the splunk module API?
I'm really not sure how to do "1". How do we find the module object?
I was able to call the splunk root module (the TRP) and then push context downstream. This was after passing the MultiLineInputters (MLI) context upstream to ensure the context remains intact from each MLI. I believe we potentially bypass the clobber factor, by exporting the context to the root, using "passContextToParent". In terms of UI impact, this allows users to submit their modified search from any MLI of their choosing. Leaving in that UI feature, helps prevent users from navigating a swath of web page collateral to reignite a search from the TRP.
I guess a proper modular addition or change should be a single boolean param to indicate if it's the first module. That will provide the condition to append "| where" in the search.
I've attached the code mod within TextInputterModule.
pushSearch: function() {
this.prepareContext();
this.passContextToParent(this.prepareContext());
var root = this.getRootAncestor();
root.pushContextToChildren();
},
There are several other great modular traversal methods, I refer those interested to this link: http://dev.splunk.com/view/SP-CAAADW2
I love the concept of your new sideview feature. Especially given the MLI multi module solution uses substantial UI real estate.
In the new side view modules it would be great if the combination of the new TextField and ArrayValueSetter modules could provide multiple types of search terms such that | where foo1="line1" OR foo2="line2" OR foobar="line3", that essentially would entirely solve this "hack" workaround.
Thank you for being generous enough to help explain these topics. It's a tremendous contribution!
I placed this comment as an answer due to the size limitations. For some reason I keep getting the spinner when I try to post this answer as "comment". Maybe it's due to that limit? Not sure.
Cheers,
Wade
... View more