<?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: Possible &amp;quot;Race Condition&amp;quot; From SPL code to Dashboard code running using lookuptables in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415598#M119624</link>
    <description>&lt;P&gt;The problem has to be related to how &lt;CODE&gt;enter_saved_test_id&lt;/CODE&gt; is being set.  Show all of the other XML, especially the form inputs.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2019 17:42:30 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-01-21T17:42:30Z</dc:date>
    <item>
      <title>Possible "Race Condition" From SPL code to Dashboard code running using lookuptables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415596#M119622</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;A SPL line is retrieving data 100% all of the time, but it retrieves data 70% of the time when used as dashboard code &lt;STRONG&gt;"Test not found"&lt;/STRONG&gt; pops up). &lt;/P&gt;

&lt;P&gt;Its like the query did not run correctly and returns 0. its like there is a "&lt;STRONG&gt;race condition&lt;/STRONG&gt;"&lt;/P&gt;

&lt;P&gt;..any ideas would be great and thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt;
    &amp;lt;!-- Search Test ID Details in SavedTest.csv--&amp;gt;
    &amp;lt;query&amp;gt;| inputlookup Saved_Tests.csv | where ID="$enter_saved_test_id$" | table ID, Host, Test_Name, Comments, Status, Start, Stop, Version, MX_Build_ID,  Log_or_Live&amp;lt;/query&amp;gt;
            &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition match="'job.resultCount'==0"&amp;gt;
        &amp;lt;set token="form.enter_saved_test_id"&amp;gt;Test not found&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition&amp;gt;
        &amp;lt;unset token="execute_save_test"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;unset token="save_test"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;set token="host_token"&amp;gt;$result.Host$&amp;lt;/set&amp;gt;
        &amp;lt;set token="form.host_token"&amp;gt;$result.Host$&amp;lt;/set&amp;gt;
        &amp;lt;set token="form.time_token.earliest"&amp;gt;$result.Start$&amp;lt;/set&amp;gt;
        &amp;lt;set token="form.time_token.latest"&amp;gt;$result.Stop$&amp;lt;/set&amp;gt;
        &amp;lt;eval token="form.save_test_status"&amp;gt;$result.Status$&amp;lt;/eval&amp;gt;
        &amp;lt;set token="form.save_test_name_token"&amp;gt;$result.Test_Name$&amp;lt;/set&amp;gt;
        &amp;lt;set token="form.save_test_comments"&amp;gt;$result.Comments$&amp;lt;/set&amp;gt;
        &amp;lt;set token="saved_test_id"&amp;gt;$result.ID$&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6409iF77C112F1E5139FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 12:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415596#M119622</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2019-01-21T12:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Possible "Race Condition" From SPL code to Dashboard code running using lookuptables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415597#M119623</link>
      <description>&lt;P&gt;@robertlynch2020 how many records are present in your lookup? Can you test with the following query?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Saved_Tests.csv where ID="$enter_saved_test_id$" 
| table ID, Host, Test_Name, Comments, Status, Start, Stop, Version, MX_Build_ID,  Log_or_Live
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How is the token &lt;CODE&gt;$enter_saved_test_id$&lt;/CODE&gt; being set? Can you share that piece of code as well?&lt;BR /&gt;
What are the two unset tokens used for and also how are you testing whether search returned results in Dashboard or not?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 16:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415597#M119623</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-01-21T16:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Possible "Race Condition" From SPL code to Dashboard code running using lookuptables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415598#M119624</link>
      <description>&lt;P&gt;The problem has to be related to how &lt;CODE&gt;enter_saved_test_id&lt;/CODE&gt; is being set.  Show all of the other XML, especially the form inputs.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 17:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415598#M119624</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-21T17:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Possible "Race Condition" From SPL code to Dashboard code running using lookuptables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415599#M119625</link>
      <description>&lt;P&gt;HI&lt;/P&gt;

&lt;P&gt;I have removed some of the tokens that were not been used, but the issue can still happen - But not as frequent.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_cell_highlighting.js,table_cell_highlighting1.js" hideFilters="true" refresh="30"&amp;gt;
  &amp;lt;label&amp;gt;KPI_MONITORING&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;Last 12 Hours  by default (Auto Refresh 30 seconds)&amp;lt;/description&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;!-- Search Test ID Details in SavedTest.csv--&amp;gt;
    &amp;lt;query&amp;gt;| inputlookup Saved_Tests.csv | where ID="$enter_saved_test_id$" | table ID, Host, Test_Name, Comments, Status, Start, Stop, Version, MX_Build_ID,  Log_or_Live&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition match="'job.resultCount'==0"&amp;gt;
        &amp;lt;set token="form.enter_saved_test_id"&amp;gt;Test not found&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition&amp;gt;

        &amp;lt;set token="form.time_token.earliest"&amp;gt;$result.Start$&amp;lt;/set&amp;gt;
        &amp;lt;set token="form.time_token.latest"&amp;gt;$result.Stop$&amp;lt;/set&amp;gt;

      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="time_token"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="enter_saved_test_id" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Enter an existing SPLUNK_ID&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Jan 2019 12:12:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415599#M119625</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2019-01-22T12:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Possible "Race Condition" From SPL code to Dashboard code running using lookuptables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415600#M119626</link>
      <description>&lt;P&gt;Hi Woodcook&lt;/P&gt;

&lt;P&gt;This is a funny one, sometimes is happens a lot and other times it does not happen as much. So i as startign to think is it to do with other verabiles not just the dashboard code..&lt;/P&gt;

&lt;P&gt;Below is how i set the enter_saved_test_id - a simple input.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;/input&amp;gt;
        &amp;lt;input type="text" token="enter_saved_test_id" searchWhenChanged="true"&amp;gt;
          &amp;lt;label&amp;gt;Enter an existing SPLUNK_ID&amp;lt;/label&amp;gt;
        &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415600#M119626</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2020-09-29T22:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Possible "Race Condition" From SPL code to Dashboard code running using lookuptables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415601#M119627</link>
      <description>&lt;P&gt;Did you know you could just do &lt;BR /&gt;
| inputlookup Saved_Tests.csv where ID="$enter_saved_test_id$ | .... etc&lt;BR /&gt;
 I'm not sure but this may speed up your search, vs loading the entire lookup file and then whittling it down after.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:56:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415601#M119627</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2020-09-29T22:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Possible "Race Condition" From SPL code to Dashboard code running using lookuptables</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415602#M119628</link>
      <description>&lt;P&gt;Hi Robert, &lt;/P&gt;

&lt;P&gt;Might be a bit different method to attack this but try the following: &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Ensure you have a valid input tag:&lt;/P&gt;

&lt;P&gt;&lt;LABEL&gt;Test ID&lt;/LABEL&gt;&lt;BR /&gt;
  &lt;DEFAULT&gt;&lt;/DEFAULT&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Pipe it to a panel:&lt;/P&gt;

&lt;P&gt;&lt;TABLE&gt;&lt;BR /&gt;
    &lt;TITLE&gt;Search &lt;/TITLE&gt;&lt;BR /&gt;
    &lt;SEARCH&gt;&lt;BR /&gt;
      &lt;QUERY&gt; | inputlookup append=true Saved_Tests.csv  WHERE &lt;BR /&gt;
         (ID="$enter_saved_test_id$") &lt;BR /&gt;
   &lt;/QUERY&gt;&lt;BR /&gt;
    &lt;/SEARCH&gt;&lt;BR /&gt;
    10&lt;BR /&gt;
    none&lt;BR /&gt;
    cell&lt;BR /&gt;
    preview&lt;BR /&gt;
    false&lt;BR /&gt;
    false&lt;BR /&gt;
  &lt;/TABLE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-quot-Race-Condition-quot-From-SPL-code-to-Dashboard/m-p/415602#M119628</guid>
      <dc:creator>tomsterkw</dc:creator>
      <dc:date>2020-09-29T22:58:52Z</dc:date>
    </item>
  </channel>
</rss>

