<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Token Not Ready When Search Executes on Page Load in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749050#M242080</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249836"&gt;@tomapatan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you able to visualise what the&amp;nbsp;row_count_tok token is set to by your JS? It sounds like the queries do not see it as being set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its worth adding the token in a title or html somewhere so you can confirm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jul 2025 16:12:33 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-07-01T16:12:33Z</dc:date>
    <item>
      <title>Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749048#M242078</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I’ve got a dashboard that uses a JS script to dynamically set the $row_count_tok$ token based on screen orientation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;24 for landscape (2 pages of 12 rows)&lt;/LI&gt;&lt;LI&gt;40 for portrait (2 pages of 20 rows)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I pass this token into my search to determine how many rows to return, and then paginate them like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;......
| head $row_count_tok$
| streamstats count as Page
| eval Page = case(
    $row_count_tok$=24 AND Page&amp;lt;=12, 0,
    $row_count_tok$=24 AND Page&amp;gt;12, 1,
    $row_count_tok$=40 AND Page&amp;lt;=20, 0,
    $row_count_tok$=40 AND Page&amp;gt;20, 1
)
| eval display = floor(tonumber(strftime(now(), "%S")) / 10) % 2
| where Page = display
| fields - display&lt;/LI-CODE&gt;&lt;P&gt;The token and logic work (tested manually), but I get this message on page load indicating the token was not ready when the search ran:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; Search is waiting for input...&lt;/LI-CODE&gt;&lt;P&gt;How do I force the query to wait for the token to load ?&lt;BR /&gt;&lt;BR /&gt;Many thanks.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 15:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749048#M242078</guid>
      <dc:creator>tomapatan</dc:creator>
      <dc:date>2025-07-01T15:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749050#M242080</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249836"&gt;@tomapatan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you able to visualise what the&amp;nbsp;row_count_tok token is set to by your JS? It sounds like the queries do not see it as being set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its worth adding the token in a title or html somewhere so you can confirm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 16:12:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749050#M242080</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-07-01T16:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749051#M242081</link>
      <description>&lt;P&gt;Yes, the $&lt;SPAN&gt;row_count_tok$ is being set accordingly (24 or 40, depending on the screen orientation).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 16:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749051#M242081</guid>
      <dc:creator>tomapatan</dc:creator>
      <dc:date>2025-07-01T16:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749053#M242082</link>
      <description>&lt;P&gt;For some additional context — the dashboard actually works unless I switch from portrait to landscape or the other way round. When that happens,&amp;nbsp;the only way to resolve is to enter edit mode and then exit without making any changes. Simply refreshing the page doesn't work as expected, although the token does update automatically (I`ve got the token in a title so I can view it`s values).&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 16:47:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749053#M242082</guid>
      <dc:creator>tomapatan</dc:creator>
      <dc:date>2025-07-01T16:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749055#M242084</link>
      <description>&lt;P&gt;This is happening because I`ve got this set up, and it looks like the only way to refresh is to enter edit mode and exit without saving. Any ideas ? cc&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;option name="count"&amp;gt;$row_count_tok$&amp;lt;/option&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 16:52:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749055#M242084</guid>
      <dc:creator>tomapatan</dc:creator>
      <dc:date>2025-07-01T16:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749069#M242087</link>
      <description>&lt;P&gt;I have a feeling that using tokens in the count part of the XML config was broken at some point. It used to work, then it stopped working, but now I tested again, it does work - what version are you on?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 23:24:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749069#M242087</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-07-01T23:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749085#M242092</link>
      <description>&lt;P&gt;Done some further testing and the "Search is waiting for input.." is caused by the query below and not the count part in XML:&lt;/P&gt;&lt;P&gt;| head $row_count_tok$&lt;BR /&gt;| streamstats count as Page&lt;BR /&gt;| eval Page = case(&lt;BR /&gt;$row_count_tok$=24 AND Page&amp;lt;=12, 0,&lt;BR /&gt;$row_count_tok$=24 AND Page&amp;gt;12, 1,&lt;BR /&gt;$row_count_tok$=40 AND Page&amp;lt;=20, 0,&lt;BR /&gt;$row_count_tok$=40 AND Page&amp;gt;20, 1&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;But I`m not sure why, as the token is in a title and I can see it`s values being extracted correctly (24 if in landscape mode or 40 if in portrait).&lt;BR /&gt;If I refresh the browser the issue persists, if I go into editxml mode and cancel without making any changes the panel displays fine.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 09:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749085#M242092</guid>
      <dc:creator>tomapatan</dc:creator>
      <dc:date>2025-07-02T09:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Token Not Ready When Search Executes on Page Load</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749100#M242098</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Managed to get this resolved by ensuring the submitted token model was updated by adding&amp;nbsp;submittedTokenModel.set()&amp;nbsp;and submittedTokenModel.trigger() to the code.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;The title displaying the token value was a bit of a red herring. It showed that the default model was being updated, but it didn't reflect the state of the submitted token model.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 12:39:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Token-Not-Ready-When-Search-Executes-on-Page-Load/m-p/749100#M242098</guid>
      <dc:creator>tomapatan</dc:creator>
      <dc:date>2025-07-02T12:39:05Z</dc:date>
    </item>
  </channel>
</rss>

