<?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: Using Eval statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356570#M105519</link>
    <description>&lt;P&gt;Thanks somesoni &amp;amp; ssadanala1 it worked for me now.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 20:14:32 GMT</pubDate>
    <dc:creator>Splunk_rocks</dc:creator>
    <dc:date>2018-04-23T20:14:32Z</dc:date>
    <item>
      <title>Using Eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356565#M105514</link>
      <description>&lt;P&gt;Hello Splunkers, &lt;BR /&gt;
I have case field with below information so i need to construct Eval field. &lt;/P&gt;

&lt;P&gt;&lt;EM&gt;case&lt;/EM&gt;**&lt;/P&gt;

&lt;P&gt;XYZ&lt;BR /&gt;
2&lt;BR /&gt;
0&lt;BR /&gt;
3&lt;BR /&gt;
yzr &lt;/P&gt;

&lt;P&gt;Now i have to construct eval field like &lt;/P&gt;

&lt;P&gt;If case=string then print case as it was in case field&lt;BR /&gt;
    case=2 then print " error code 2"&lt;BR /&gt;
    case =3 the print " error code 3"&lt;BR /&gt;
    case=0  then " error zero "&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 19:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356565#M105514</guid>
      <dc:creator>Splunk_rocks</dc:creator>
      <dc:date>2018-04-23T19:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using Eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356566#M105515</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval temp="XYZ,2,0,3,yzr" &lt;BR /&gt;
| eval temp = split(temp,",") &lt;BR /&gt;
| mvexpand temp &lt;BR /&gt;
| eval status = case (temp=2 ,"error code 2 ", temp=3 ,"errorcode 3",temp = 0 , "error code 0",if(isstr(temp),"yes","no")=="yes" ,temp)&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 19:32:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356566#M105515</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2018-04-23T19:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using Eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356567#M105516</link>
      <description>&lt;P&gt;Thanks but that will not fulfill my req i need add Eval field to props file based on  output.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 19:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356567#M105516</guid>
      <dc:creator>Splunk_rocks</dc:creator>
      <dc:date>2018-04-23T19:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356568#M105517</link>
      <description>&lt;P&gt;You can use this in caluclated fields in props.conf by specifying like this &lt;/P&gt;

&lt;P&gt;EVAL-status =  case (temp=2 ,"error code 2 ", temp=3 ,"errorcode 3",temp = 0 , "error code 0",if(isstr(temp),"yes","no")=="yes" ,temp)&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 19:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356568#M105517</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2018-04-23T19:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356569#M105518</link>
      <description>&lt;P&gt;Minor cosmetic correction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-status = case (temp=2 ,"error code 2 ", temp=3 ,"errorcode 3",temp = 0 , "error code 0",isstr(temp), ,temp)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Apr 2018 19:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356569#M105518</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-23T19:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356570#M105519</link>
      <description>&lt;P&gt;Thanks somesoni &amp;amp; ssadanala1 it worked for me now.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 20:14:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Eval-statement/m-p/356570#M105519</guid>
      <dc:creator>Splunk_rocks</dc:creator>
      <dc:date>2018-04-23T20:14:32Z</dc:date>
    </item>
  </channel>
</rss>

