Splunk Search

Is there any way to pass JavaScript variable to search module in view XML?

kasu_praveen
Communicator

Is there any way to pass JavaScript variable to search module in view XML?

My JavaScript code (application.js) generates field list to filter out the search results in my view XML. Is there any way to pass data from JS to view XML?

JavaScript code:

`function myCustomFunc(){
var fieldList
....
....
....
return fieldList;
}`

View XML:

`<module name="Search" layoutPanel="appHeader">
<param name="search">
...|...|...| table fieldList
</param>
</module>`
Tags (3)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You can use the CustomBehavior module available in SideviewUtils. For an example of setting a value that can be used as $value$ in downstream modules you can take a look at the search_exploder view along with its search_exploder.js JavaScript file.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

You can use the CustomBehavior module available in SideviewUtils. For an example of setting a value that can be used as $value$ in downstream modules you can take a look at the search_exploder view along with its search_exploder.js JavaScript file.

helenashton
Path Finder

A follow on from this:
My understanding is that this requires editing a js file. And it seems like I might have to have the same validation for all input boxes?
Is there a way to specify this from within the advanced XML dashboard?

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...