Building for the Splunk Platform

looking for proper way to dynamically set 'search' property in PostProcessManager (splunkjs outside of Splunk)

pgoldweic
Communicator

Hi,
I'm looking for the proper way to set the 'search' property of a PostProcessManager in splunkjs within an app that runs outside of Splunk Enterprise. Documentation on this is not clear, and my trials have been unsuccessful, as follows:

 myManager.set("search", <mysearchstring>)    is apparently syntactically correct, but returns no results
 myManager.settings.set("search", <mysearchstring>)   is apparently syntactically correct, but returns no results
 myManager.search.set(<mysearchstring>) is apparently syntactically correct but causes no update in the display
 myManager.query.set(<mysearchstring) is also syntactically correct but causes no update in the display

NOTES:
- After setting the search query, I'm also calling 'startSearch()' on the search manager, and then render() on the chart
- Before responding, please note that this is for apps outside of Splunk and not otherwise. See examples for this type of apps in https://dev.splunk.com/enterprise/docs/developapps/webframework/codeexamplefw/splunkjsstack/searchco... This is where the 'manager.search.set' and 'manager.query.set' are used in examples with plain SearchManager instances)

Thanks in advance for any help.

Labels (1)
0 Karma
1 Solution

pgoldweic
Communicator

I've been able to find the answer to my question after I kept experimenting. Turns out that option #2 above is the correct one. I was originally confused by the fact that the search was returning no results, but eventually I figured out that it was due to a mistake I had made when creating the search query.

View solution in original post

0 Karma

pgoldweic
Communicator

I've been able to find the answer to my question after I kept experimenting. Turns out that option #2 above is the correct one. I was originally confused by the fact that the search was returning no results, but eventually I figured out that it was due to a mistake I had made when creating the search query.

0 Karma
Get Updates on the Splunk Community!

This Week's Community Digest - Splunk Community Happenings [9.26.22]

Get the latest news and updates from the Splunk Community here! Upcoming User Group Events! &#x1f44f; Check ...

BSides Splunk 2022 - The Call for Papers is now Open!

TLDR; Main Site: https://bsidessplunk.com CFP Site: https://bsidessplunk.com/cfp CFP Opens: December 15th, ...

Sending Metrics to Splunk Enterprise With the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...