<?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: If len() then A else B in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/If-len-then-A-else-B/m-p/480376#M192979</link>
    <description>&lt;P&gt;Hi sai33,&lt;/P&gt;

&lt;P&gt;give this a try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval A="", B="22" `comment("creates fake events")` 
| eval result_len_0=if(len(A) &amp;gt; 0, A, B)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2019 18:44:31 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2019-09-12T18:44:31Z</dc:date>
    <item>
      <title>If len() then A else B</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-len-then-A-else-B/m-p/480375#M192978</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'm looking to include a If Else Check along with Len() Function along with Eval in my Search.&lt;/P&gt;

&lt;P&gt;My Raw syntax would be something like this:&lt;BR /&gt;
If Len(A)&amp;gt;o then 'A' else 'B'&lt;/P&gt;

&lt;P&gt;Can you please help out on creating something like the above statement using Eval.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 18:28:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-len-then-A-else-B/m-p/480375#M192978</guid>
      <dc:creator>sai33</dc:creator>
      <dc:date>2019-09-12T18:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: If len() then A else B</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-len-then-A-else-B/m-p/480376#M192979</link>
      <description>&lt;P&gt;Hi sai33,&lt;/P&gt;

&lt;P&gt;give this a try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval A="", B="22" `comment("creates fake events")` 
| eval result_len_0=if(len(A) &amp;gt; 0, A, B)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 18:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-len-then-A-else-B/m-p/480376#M192979</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-09-12T18:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: If len() then A else B</title>
      <link>https://community.splunk.com/t5/Splunk-Search/If-len-then-A-else-B/m-p/480377#M192980</link>
      <description>&lt;P&gt;Thanks @MuS &lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 16:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/If-len-then-A-else-B/m-p/480377#M192980</guid>
      <dc:creator>sai33</dc:creator>
      <dc:date>2019-09-13T16:54:24Z</dc:date>
    </item>
  </channel>
</rss>

