Splunk Search

Tokens not being resolved by SearchManager

bowesmana
SplunkTrust
SplunkTrust

I am creating a SearchManager

  var detailSearch = new SearchManager({
    id: 'detailSearch',
    earliest_time: '-24h@h',
    latest_time: 'now',
    preview: true,
    cache: false,
    search: '| inputlookup dc_enrichment where _key IN ($parm_add_selection$)' +
          ...
  }, {tokens: true, tokenNamespace: 'submitted'});

and all works fine. However, I am then clearing the search to stop if re-running when the $parm_add_selection$ token changes with

      search.settings.set('search', null);

When I put back the original search with the search.settings.set(), the search does not find the results, because the search does not resolve the token and in the search.log shows it is trying to search for $parm_add_selection$

Does anyone know what the

{tokens: true, tokenNamespace: 'submitted'}

statement does in the initial constructor and if that is relevant to the problem?

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Looks like if I wrap the re-setting of the original string in mvc.tokenSafe(), it then works.

0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...