<?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: how to assign boolean result within eval? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-assign-boolean-result-within-eval/m-p/287227#M86963</link>
    <description>&lt;P&gt;How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count |fields - count |eval country = "FR;DE;GE;AN;US" |eval country = split(country,";") |mvexpand country |eval tokenValue = 1 | eval toto = if(tokenValue ==1, if(country="FR",1,0), if(country!="FR",1,0))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Dec 2016 18:42:09 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2016-12-22T18:42:09Z</dc:date>
    <item>
      <title>how to assign boolean result within eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-assign-boolean-result-within-eval/m-p/287226#M86962</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;

&lt;P&gt;I worked last week with Splunk 6.3.3 and upgraded to the latest version 6.5.&lt;/P&gt;

&lt;P&gt;I detected a problem with a search, when i try to assign a boolean result using eval function.&lt;BR /&gt;
on the Splunk 6.3.3, it worked but not with 6.5&lt;/P&gt;

&lt;P&gt;this is my request :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count |fields - count |eval country = "FR;DE;GE;AN;US" |eval country = split(country,";") |mvexpand country |eval tokenValue = 1 | eval toto = if(tokenValue ==1, country="FR", country!="FR")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the tokenValue get a dynamic value 0 or 1.&lt;BR /&gt;
how can i search or filter my events based on tokenValue?&lt;/P&gt;

&lt;P&gt;here's a picture of the error message.&lt;/P&gt;

&lt;P&gt;thx&lt;BR /&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/2260iDC014EC3DB77B846/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>Thu, 22 Dec 2016 17:35:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-assign-boolean-result-within-eval/m-p/287226#M86962</guid>
      <dc:creator>sfatnass</dc:creator>
      <dc:date>2016-12-22T17:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to assign boolean result within eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-assign-boolean-result-within-eval/m-p/287227#M86963</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count |fields - count |eval country = "FR;DE;GE;AN;US" |eval country = split(country,";") |mvexpand country |eval tokenValue = 1 | eval toto = if(tokenValue ==1, if(country="FR",1,0), if(country!="FR",1,0))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Dec 2016 18:42:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-assign-boolean-result-within-eval/m-p/287227#M86963</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-12-22T18:42:09Z</dc:date>
    </item>
  </channel>
</rss>

