<?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: Can I use an eval if statement to create a new field based on a value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251467#M75147</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| eval newfield=if(field1=0 and field2=0,1,null)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Jul 2016 14:46:03 GMT</pubDate>
    <dc:creator>twinspop</dc:creator>
    <dc:date>2016-07-11T14:46:03Z</dc:date>
    <item>
      <title>Can I use an eval if statement to create a new field based on a value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251464#M75144</link>
      <description>&lt;P&gt;I would like to use an if statement to create a new field based on a value.  Something like if field1=0 and field2=0, then create new field with value of 1.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 14:39:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251464#M75144</guid>
      <dc:creator>chadman</dc:creator>
      <dc:date>2016-07-11T14:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use an eval if statement to create a new field based on a value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251465#M75145</link>
      <description>&lt;P&gt;Hi, you can use that. Follow an old question about it: &lt;A href="https://answers.splunk.com/answers/10947/if-statement-with-multiple-tests.html"&gt;https://answers.splunk.com/answers/10947/if-statement-with-multiple-tests.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 14:42:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251465#M75145</guid>
      <dc:creator>gfreitas</dc:creator>
      <dc:date>2016-07-11T14:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use an eval if statement to create a new field based on a value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251466#M75146</link>
      <description>&lt;P&gt;Perfect!  thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 14:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251466#M75146</guid>
      <dc:creator>chadman</dc:creator>
      <dc:date>2016-07-11T14:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use an eval if statement to create a new field based on a value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251467#M75147</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| eval newfield=if(field1=0 and field2=0,1,null)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jul 2016 14:46:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251467#M75147</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-07-11T14:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use an eval if statement to create a new field based on a value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251468#M75148</link>
      <description>&lt;P&gt;If you want to use case statement this may helps &lt;/P&gt;

&lt;P&gt;search | eval newfield=case(field1=field2,1,1=1,0)&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 14:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-use-an-eval-if-statement-to-create-a-new-field-based-on-a/m-p/251468#M75148</guid>
      <dc:creator>splunkton</dc:creator>
      <dc:date>2016-07-11T14:48:33Z</dc:date>
    </item>
  </channel>
</rss>

