<?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: How to remove sourcetype from this search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193958#M55893</link>
    <description>&lt;P&gt;This also worked, but I could only select one answer as the "answer".  But thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2014 20:43:53 GMT</pubDate>
    <dc:creator>echojacques</dc:creator>
    <dc:date>2014-01-02T20:43:53Z</dc:date>
    <item>
      <title>How to remove sourcetype from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193954#M55889</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This is one of the canned correlation searches included in Splunk Enterprise Security.  How can I exclude events from a specific sourcetype from this search?  My attempt to do this (which didn't work) is also below.&lt;/P&gt;

&lt;P&gt;The original search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| `src_dest_tracker("allowed")` | lookup local=true sans_blocklist_lookup src OUTPUTNEW src_ip as src_sans_ip,src_is_sans | lookup local=true sans_blocklist_lookup dest OUTPUTNEW dest_ip as dest_sans_ip,dest_is_sans | search dest_is_sans=true OR src_is_sans=true | eval sans_ip=if(dest_is_sans=="true",dest_sans_ip,sans_ip) | eval sans_ip=if(src_is_sans=="true",src_sans_ip,sans_ip) | fields + sourcetype,src,dest,sans_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My attempt to remove results from a sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype!="IPS" | `src_dest_tracker("allowed")` | lookup local=true sans_blocklist_lookup src OUTPUTNEW src_ip as src_sans_ip,src_is_sans | lookup local=true sans_blocklist_lookup dest OUTPUTNEW dest_ip as dest_sans_ip,dest_is_sans | search dest_is_sans=true OR src_is_sans=true | eval sans_ip=if(dest_is_sans=="true",dest_sans_ip,sans_ip) | eval sans_ip=if(src_is_sans=="true",src_sans_ip,sans_ip) | fields + sourcetype,src,dest,sans_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My attempt produced the error: "Error in 'tstats' command: This command must be the first command of a search".  I tried placing the "sourcetype!="IPS" elsewhere in the search string but just got more errors.  Any help is appreciated.  Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193954#M55889</guid>
      <dc:creator>echojacques</dc:creator>
      <dc:date>2014-01-02T20:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove sourcetype from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193955#M55890</link>
      <description>&lt;P&gt;Try this (if not already tried)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| `src_dest_tracker("allowed")` | search NOT sourcetype="IPS" | lookup local=true sans_blocklist_lookup src OUTPUTNEW src_ip as src_sans_ip,src_is_sans | lookup local=true sans_blocklist_lookup dest OUTPUTNEW dest_ip as dest_sans_ip,dest_is_sans | search dest_is_sans=true OR src_is_sans=true | eval sans_ip=if(dest_is_sans=="true",dest_sans_ip,sans_ip) | eval sans_ip=if(src_is_sans=="true",src_sans_ip,sans_ip) | fields + sourcetype,src,dest,sans_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193955#M55890</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-01-02T20:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove sourcetype from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193956#M55891</link>
      <description>&lt;P&gt;I don't know exactly what is in the &lt;CODE&gt;src_dest_tracker&lt;/CODE&gt; macro, so there might be a more efficient way to do what you want, but this will work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| `src_dest_tracker("allowed")` 
| where sourcetype!="IPS" 
| lookup local=true sans_blocklist_lookup src OUTPUTNEW src_ip as src_sans_ip,src_is_sans | lookup local=true sans_blocklist_lookup dest OUTPUTNEW dest_ip as dest_sans_ip,dest_is_sans | search dest_is_sans=true OR src_is_sans=true | eval sans_ip=if(dest_is_sans=="true",dest_sans_ip,sans_ip) | eval sans_ip=if(src_is_sans=="true",src_sans_ip,sans_ip) | fields + sourcetype,src,dest,sans_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The macro contains the initial search, so your condition must follow that. Note I put in in a &lt;CODE&gt;where&lt;/CODE&gt; command, as the second command in the pipeline. Everything else remains the same.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193956#M55891</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-01-02T20:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove sourcetype from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193957#M55892</link>
      <description>&lt;P&gt;This worked perfectly, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193957#M55892</guid>
      <dc:creator>echojacques</dc:creator>
      <dc:date>2014-01-02T20:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove sourcetype from this search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193958#M55893</link>
      <description>&lt;P&gt;This also worked, but I could only select one answer as the "answer".  But thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2014 20:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-sourcetype-from-this-search/m-p/193958#M55893</guid>
      <dc:creator>echojacques</dc:creator>
      <dc:date>2014-01-02T20:43:53Z</dc:date>
    </item>
  </channel>
</rss>

