<?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: Combine two searches using Eval with Case statement. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236425#M188570</link>
    <description>&lt;P&gt;Give this a try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=Firewall action=allowed port=21 OR port=22 OR port=20
| eval Direction=case(dst!="10.0.0.0/8" AND  dst!="192.168.0.0/16","OUTBOUND",src!="10.0.0.0/8" AND src!="192.168.0.0/16","INBOUND",1=1,"Other") | where Direction!="Other" | iplocation dst | rename Country as Country_dst | iplocation src | where Country!="United States" OR Country_dst!="United States" | stats Count byCountry src dst port action Direction
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 08 Mar 2016 22:39:49 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-03-08T22:39:49Z</dc:date>
    <item>
      <title>Combine two searches using Eval with Case statement.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236423#M188568</link>
      <description>&lt;P&gt;Combine two searches using Eval with Case statement.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2016 21:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236423#M188568</guid>
      <dc:creator>abdimustafa12</dc:creator>
      <dc:date>2016-03-08T21:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two searches using Eval with Case statement.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236424#M188569</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype=Firewall action=allowed (port=21 OR port=22 OR port=20) 
       (dst!=10.0.0.0/8 dst!=192.168.0.0/16 ) OR (src!=10.0.0.0/8 src!=192.168.0.0/16)
| iplocation dst
| search Country!="United States"
| stats Count by Country src dst port action
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is a start - but the real problem is: how do you determine the direction? Without that information, the whole search doesn't really make sense to me.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2016 21:45:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236424#M188569</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-03-08T21:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two searches using Eval with Case statement.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236425#M188570</link>
      <description>&lt;P&gt;Give this a try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=Firewall action=allowed port=21 OR port=22 OR port=20
| eval Direction=case(dst!="10.0.0.0/8" AND  dst!="192.168.0.0/16","OUTBOUND",src!="10.0.0.0/8" AND src!="192.168.0.0/16","INBOUND",1=1,"Other") | where Direction!="Other" | iplocation dst | rename Country as Country_dst | iplocation src | where Country!="United States" OR Country_dst!="United States" | stats Count byCountry src dst port action Direction
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Mar 2016 22:39:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236425#M188570</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-08T22:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Combine two searches using Eval with Case statement.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236426#M188571</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=Firewall action=allowed port=21 OR port=22 OR port=20
 | eval Direction=case((dst!="10.0.0.0/8" AND  dst!="192.168.0.0/16"),"OUTBOUND",(src!="10.0.0.0/8" AND src!="192.168.0.0/16"),"INBOUND")| iplocation dst | where Country!="United States" | stats Count by Country src dst port action Direction
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Mar 2016 08:47:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-two-searches-using-Eval-with-Case-statement/m-p/236426#M188571</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2016-03-09T08:47:00Z</dc:date>
    </item>
  </channel>
</rss>

