<?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 eval if isnull hope fill other values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146858#M185266</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;

&lt;P&gt;My weburl sometim is null, i hope if weburl is null then weburl1 fill to weburl. I'm try "eval n=if(isnull(hostname),weburl1)" but fail, how should i do? Thanks.&lt;/P&gt;

&lt;P&gt;index=xx | fillnull value=SSL attack|  eval bandwidth=rcvdbyte+sentbyte | eval bandwidth(MB) = round(bandwidth/1024/1024,2) | strcat " " date " " time " " as Date |strcat " " hostname url " " as weburl | strcat " " host_name url " " as weburl1 | eval n=if(isnull(hostname),weburl1)|stats sum(bandwidth(MB)) as bandwidth(MB) values(srcip) as srcip values(service) as service values(attack) as app last(Date) as LastDate first(Date) as FirstDate  values(weburl) as weburl values(weburl1) as weburl1 values(policyid) as policyid values(n) as n by dstip | table srcip,dstip,app,service,LastDate,FirstDate,weburl,weburl1,bandwidth(MB),policyid,n |sort 10 bandwidth(MB) desc&lt;/P&gt;</description>
    <pubDate>Wed, 30 Apr 2014 07:28:27 GMT</pubDate>
    <dc:creator>chengyu</dc:creator>
    <dc:date>2014-04-30T07:28:27Z</dc:date>
    <item>
      <title>eval if isnull hope fill other values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146858#M185266</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;

&lt;P&gt;My weburl sometim is null, i hope if weburl is null then weburl1 fill to weburl. I'm try "eval n=if(isnull(hostname),weburl1)" but fail, how should i do? Thanks.&lt;/P&gt;

&lt;P&gt;index=xx | fillnull value=SSL attack|  eval bandwidth=rcvdbyte+sentbyte | eval bandwidth(MB) = round(bandwidth/1024/1024,2) | strcat " " date " " time " " as Date |strcat " " hostname url " " as weburl | strcat " " host_name url " " as weburl1 | eval n=if(isnull(hostname),weburl1)|stats sum(bandwidth(MB)) as bandwidth(MB) values(srcip) as srcip values(service) as service values(attack) as app last(Date) as LastDate first(Date) as FirstDate  values(weburl) as weburl values(weburl1) as weburl1 values(policyid) as policyid values(n) as n by dstip | table srcip,dstip,app,service,LastDate,FirstDate,weburl,weburl1,bandwidth(MB),policyid,n |sort 10 bandwidth(MB) desc&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2014 07:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146858#M185266</guid>
      <dc:creator>chengyu</dc:creator>
      <dc:date>2014-04-30T07:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: eval if isnull hope fill other values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146859#M185267</link>
      <description>&lt;P&gt;Hi chengyu,&lt;/P&gt;

&lt;P&gt;your &lt;CODE&gt;eval&lt;/CODE&gt; is missing the third argument in the &lt;CODE&gt;if&lt;/CODE&gt; statement. Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval n=if(isnull(hostname), weburl1, "ThereIsAhostname")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can use as third argument another field's value or some boolean test like I did.&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2014 07:42:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146859#M185267</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-30T07:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: eval if isnull hope fill other values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146860#M185268</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;coalesce()&lt;/CODE&gt; to use the first value from a list of fields that isn't null:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval weburl = coalesce(weburl, weburl1, weburl2, weburl3, ...) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Apr 2014 07:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146860#M185268</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-30T07:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: eval if isnull hope fill other values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146861#M185269</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;last modify success, thank guts.&lt;BR /&gt;
| eval n = coalesce(hostname, host_name) |strcat " " n url " " as weburl3 |...&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2014 09:00:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-if-isnull-hope-fill-other-values/m-p/146861#M185269</guid>
      <dc:creator>chengyu</dc:creator>
      <dc:date>2014-04-30T09:00:18Z</dc:date>
    </item>
  </channel>
</rss>

