<?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: Why is setting a token from result not working? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324784#M96869</link>
    <description>&lt;P&gt;If you do not know whom to credit then go back to each answer and comment that assisted you and upvote (yes, you can upvote comments; go ahead and try on this one)!&lt;/P&gt;</description>
    <pubDate>Sat, 25 Mar 2017 10:30:15 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-03-25T10:30:15Z</dc:date>
    <item>
      <title>Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324769#M96854</link>
      <description>&lt;P&gt;Any ideas on why KER_RESULT would not be working? Tail end of base query... &lt;/P&gt;

&lt;P&gt;Updated code... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;search id="events"&amp;gt;
    &amp;lt;query&amp;gt;$environment$ $bloomfilter$ `Errors` 
| eval KER_EDIT=KER
| search Client_Impact!="Normal_Dialog" $searchType$$searchField$
| table _time ErrorLogID KER
    &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$timerange.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$timerange.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
        &amp;lt;condition match="'job.resultCount' == 1"&amp;gt;
          &amp;lt;set token="KER"&amp;gt;$result.KER$&amp;lt;/set&amp;gt;
          &amp;lt;set token="singleresult"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;set token="runDuration"&amp;gt;$job.runDuration$&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition match="'job.resultCount' != 1"&amp;gt;
          &amp;lt;set token="runDuration"&amp;gt;$job.runDuration$&amp;lt;/set&amp;gt;
          &amp;lt;unset token="singleresult"&amp;gt;&amp;lt;/unset&amp;gt;
          &amp;lt;unset token="KER"&amp;gt;&amp;lt;/unset&amp;gt;
        &amp;lt;/condition&amp;gt;
     &amp;lt;/done&amp;gt;
     &amp;lt;finalized&amp;gt;
        &amp;lt;eval token="KER_COLUMN"&amp;gt;coalesce($view$,"KER")&amp;lt;/eval&amp;gt;
     &amp;lt;/finalized&amp;gt;
 &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There is a single result and a KER value but the KER_RESULT token keeps coming back as $result.KER$ even though singleresult token is returning true.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 21:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324769#M96854</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2017-02-23T21:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324770#M96855</link>
      <description>&lt;P&gt;Try this &lt;CODE&gt;&amp;lt;condition match=" 'job.resultCount' == 1"&amp;gt;&lt;/CODE&gt; instead of &lt;CODE&gt;&amp;lt;condition match="$job.resultCount$ == 1"&amp;gt;&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/Viz/tokens#Search_tokens_for_dynamic_display_example"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/Viz/tokens#Search_tokens_for_dynamic_display_example&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 21:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324770#M96855</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-23T21:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324771#M96856</link>
      <description>&lt;P&gt;I just tried your code above and it worked perfectly for me ... Is there any other part of your dashboard that could be affecting this?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 22:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324771#M96856</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2017-02-23T22:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324772#M96857</link>
      <description>&lt;P&gt;interface note - if you add a line with &lt;CODE&gt;&amp;lt;query&amp;gt;&lt;/CODE&gt; at the front of the code you posted, all the colors will straighten out so that only the literals are green.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 03:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324772#M96857</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-24T03:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324773#M96858</link>
      <description>&lt;P&gt;Can you try couple of things?&lt;/P&gt;

&lt;P&gt;1) Print a table with required fields in your base search &lt;CODE&gt;| table  _time ErrorLogID KER&lt;/CODE&gt; (also run independently to confirm that only one row exist and data is getting populated. You should not get No results found)&lt;BR /&gt;
2) Changing  match condition from&lt;CODE&gt;$job.resultCount$==1&lt;/CODE&gt; to &lt;CODE&gt;$job.resultCount$!=0&lt;/CODE&gt;. This way there will just be two condition blocks i.e. eith results are returned or not returned.&lt;BR /&gt;
3) I am not sure if the following will help but changing Search Event Handler from &lt;STRONG&gt;done&lt;/STRONG&gt; to &lt;STRONG&gt;progress&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 06:37:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324773#M96858</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-02-24T06:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324774#M96859</link>
      <description>&lt;P&gt;I added more of surrounding code... it is a base search and there is a finalized event handler at the end but pulling that did not fix.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 13:06:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324774#M96859</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2017-02-24T13:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324775#M96860</link>
      <description>&lt;P&gt;@niketnilay Updated with more of surrounding code. Tried your suggestions, no improvement.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 13:11:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324775#M96860</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2017-02-24T13:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324776#M96861</link>
      <description>&lt;P&gt;Thanks, no change. Updated with more of surrounding code.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 13:12:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324776#M96861</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2017-02-24T13:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324777#M96862</link>
      <description>&lt;P&gt;You should post the whole dashboard code IMHO.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 13:58:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324777#M96862</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-02-24T13:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324778#M96863</link>
      <description>&lt;P&gt;@jkat54 a bit of a pain to sanitize from internal references... may resort to that eventually.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 14:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324778#M96863</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2017-02-24T14:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324779#M96864</link>
      <description>&lt;P&gt;Which version of Splunk are you using?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324779#M96864</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-02-24T15:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324780#M96865</link>
      <description>&lt;P&gt;Enterprise 6.4.1&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:22:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324780#M96865</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2017-02-24T15:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324781#M96866</link>
      <description>&lt;P&gt;Strange result.field token should be available in preview and finalized event for Splunk 6.4.1.&lt;BR /&gt;
Can you please confirm if you are using query like the one below? It should either hit the first block or second block...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;preview&amp;gt;
     &amp;lt;condition match="'job.resultCount' == 0"&amp;gt;
       &amp;lt;set token="runDuration"&amp;gt;$job.runDuration$&amp;lt;/set&amp;gt;
       &amp;lt;unset token="singleresult"&amp;gt;&amp;lt;/unset&amp;gt;
       &amp;lt;unset token="KER"&amp;gt;&amp;lt;/unset&amp;gt;
       &amp;lt;set token="test"&amp;gt;NoResults&amp;lt;/set&amp;gt;
     &amp;lt;/condition&amp;gt;
     &amp;lt;condition&amp;gt;
       &amp;lt;set token="KER"&amp;gt;$result.KER$&amp;lt;/set&amp;gt;
       &amp;lt;set token="singleresult"&amp;gt;true&amp;lt;/set&amp;gt;
       &amp;lt;set token="runDuration"&amp;gt;$job.runDuration$&amp;lt;/set&amp;gt;
       &amp;lt;set token="test"&amp;gt;ResultsFound&amp;lt;/set&amp;gt;
     &amp;lt;/condition&amp;gt;
  &amp;lt;/preview&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have also added test token... Can you print to confirm which block is being hit?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324781#M96866</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-02-24T16:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324782#M96867</link>
      <description>&lt;P&gt;Thanks for all the help troubleshooting. Not sure who to credit answer too... but when I eliminated extra event handler and put everything in finalized it works. &lt;/P&gt;

&lt;P&gt;Finalized vs above...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;finalized&amp;gt;
        &amp;lt;condition match="'job.resultCount' == 1"&amp;gt;
          &amp;lt;set token="KER"&amp;gt;$result.KER$&amp;lt;/set&amp;gt;
          &amp;lt;set token="singleresult"&amp;gt;true&amp;lt;/set&amp;gt;
          &amp;lt;set token="runDuration"&amp;gt;$job.runDuration$&amp;lt;/set&amp;gt;
          &amp;lt;eval token="KER_COLUMN"&amp;gt;coalesce($view$,"KER")&amp;lt;/eval&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition match="'job.resultCount' != 1"&amp;gt;
          &amp;lt;set token="runDuration"&amp;gt;$job.runDuration$&amp;lt;/set&amp;gt;
          &amp;lt;unset token="singleresult"&amp;gt;&amp;lt;/unset&amp;gt;
          &amp;lt;unset token="KER"&amp;gt;&amp;lt;/unset&amp;gt;
          &amp;lt;eval token="KER_COLUMN"&amp;gt;coalesce($view$,"KER")&amp;lt;/eval&amp;gt;
        &amp;lt;/condition&amp;gt;
     &amp;lt;/finalized&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thought I had tried this.&lt;/P&gt;

&lt;P&gt;Also eliminated some unnecessary table drilldown options in an event handler elsewhere... good news is working now. &lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 17:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324782#M96867</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2017-02-24T17:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324783#M96868</link>
      <description>&lt;P&gt;Cheers everyone!!!&lt;/P&gt;

&lt;P&gt;@snoobzilla ...You can mark your own previous comment as the answer!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 19:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324783#M96868</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-02-24T19:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why is setting a token from result not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324784#M96869</link>
      <description>&lt;P&gt;If you do not know whom to credit then go back to each answer and comment that assisted you and upvote (yes, you can upvote comments; go ahead and try on this one)!&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2017 10:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-setting-a-token-from-result-not-working/m-p/324784#M96869</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-25T10:30:15Z</dc:date>
    </item>
  </channel>
</rss>

