<?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: Eval and If else value return or else null in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336724#M99907</link>
    <description>&lt;P&gt;Thanks  that worked ..if i want to capture word or digit  In case 5 -7 digit number or 5-8 word id.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Apr 2018 12:56:46 GMT</pubDate>
    <dc:creator>Splunk_rocks</dc:creator>
    <dc:date>2018-04-16T12:56:46Z</dc:date>
    <item>
      <title>Eval and If else value return or else null</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336722#M99905</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;Im constructing  Eval field " user1"  actually user field contain 5 digit number so i have to construct a EVAL field like &lt;/P&gt;

&lt;P&gt;index= XXX| "xxxxx" |eval user1 = if((user_pin &amp;gt; 0), "user_pin", "Unknown") | table user1 user_pin&lt;/P&gt;

&lt;P&gt;If "user1" field is 7 digit then in just return actual 7 digit number or else if it is string just say "null value"&lt;/P&gt;

&lt;P&gt;EVAL-user  = if((user1==  5 digit number ) "reportactull number ", "report null value ")&lt;/P&gt;

&lt;P&gt;Please let me know &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336722#M99905</guid>
      <dc:creator>Splunk_rocks</dc:creator>
      <dc:date>2020-09-29T19:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Eval and If else value return or else null</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336723#M99906</link>
      <description>&lt;P&gt;You say both &lt;CODE&gt;7-digit&lt;/CODE&gt; and &lt;CODE&gt;5-digit&lt;/CODE&gt; but I am assuming that you mean the latter, so like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-user=if(match(user1, "^\d{5}$"), user1, "null value")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Apr 2018 22:49:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336723#M99906</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-15T22:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Eval and If else value return or else null</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336724#M99907</link>
      <description>&lt;P&gt;Thanks  that worked ..if i want to capture word or digit  In case 5 -7 digit number or 5-8 word id.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 12:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336724#M99907</guid>
      <dc:creator>Splunk_rocks</dc:creator>
      <dc:date>2018-04-16T12:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Eval and If else value return or else null</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336725#M99908</link>
      <description>&lt;P&gt;I need to match below to construct eval field.&lt;/P&gt;

&lt;P&gt;user&lt;BR /&gt;
X234578&lt;BR /&gt;
wertyui&lt;BR /&gt;
kxtur&lt;BR /&gt;
lytue23&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 15:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336725#M99908</guid>
      <dc:creator>Splunk_rocks</dc:creator>
      <dc:date>2018-04-17T15:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Eval and If else value return or else null</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336726#M99909</link>
      <description>&lt;P&gt;Change &lt;CODE&gt;d{5}&lt;/CODE&gt; to &lt;CODE&gt;d{5-8}&lt;/CODE&gt; or similar.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 04:19:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-and-If-else-value-return-or-else-null/m-p/336726#M99909</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-20T04:19:35Z</dc:date>
    </item>
  </channel>
</rss>

