<?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: create if statment whose result will create a new field with a constant value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/create-if-statment-whose-result-will-create-a-new-field-with-a/m-p/338269#M161340</link>
    <description>&lt;P&gt;Are you looking for something like following?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Action=case(DeviceProduct=="IPS" AND pririty=="7" AND src="10.10.10.10" AND DeviceAction=="block","B",1==1,"OTHER")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Apr 2017 06:56:14 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-04-19T06:56:14Z</dc:date>
    <item>
      <title>create if statment whose result will create a new field with a constant value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/create-if-statment-whose-result-will-create-a-new-field-with-a/m-p/338267#M161338</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;

&lt;P&gt;There is a way to create if statment whose result will create a new field with a constant value?&lt;/P&gt;

&lt;P&gt;For exemple: &lt;/P&gt;

&lt;P&gt;In a ten-minute time window:&lt;BR /&gt;
if DeviceProduct=IPS pririty=7 AND src=10.10.10.10 And DeviceAction=block --&amp;gt; create new field with constant value:  &lt;STRONG&gt;Action=B&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 06:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/create-if-statment-whose-result-will-create-a-new-field-with-a/m-p/338267#M161338</guid>
      <dc:creator>bugnet</dc:creator>
      <dc:date>2017-04-19T06:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: create if statment whose result will create a new field with a constant value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/create-if-statment-whose-result-will-create-a-new-field-with-a/m-p/338268#M161339</link>
      <description>&lt;P&gt;Hi bugnet,&lt;BR /&gt;
did you tried something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval new_field=if(DeviceProduct="IPS" AND pririty=7 AND src="10.10.10.10" AND DeviceAction="block","constant_value")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 06:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/create-if-statment-whose-result-will-create-a-new-field-with-a/m-p/338268#M161339</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-04-19T06:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: create if statment whose result will create a new field with a constant value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/create-if-statment-whose-result-will-create-a-new-field-with-a/m-p/338269#M161340</link>
      <description>&lt;P&gt;Are you looking for something like following?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Action=case(DeviceProduct=="IPS" AND pririty=="7" AND src="10.10.10.10" AND DeviceAction=="block","B",1==1,"OTHER")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2017 06:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/create-if-statment-whose-result-will-create-a-new-field-with-a/m-p/338269#M161340</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-04-19T06:56:14Z</dc:date>
    </item>
  </channel>
</rss>

