<?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 Lookup table from external file for search exclusions possible? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81418#M20627</link>
    <description>&lt;P&gt;I've currently got a summary search setup going against DNS query data that I use to produce a reporting chart of the top 50 searches over the past 3 days. As part of this, I generally go through every couple days to see what is showing up in the top 50 that isn't interesting and can be discarded from the chart. This basically amounts to then appending another "query!="some.domain.y" (where "query" is a defined field in my dns eventtype") such as:&lt;/P&gt;

&lt;P&gt;sourcetype="dns" query_type="A" query!="some.domain.x" | sitop query limit="50"&lt;/P&gt;

&lt;P&gt;At this point though, this has made my search quite long as there's probably upwards of 30 or so "query!=xxxx" statements appended now. To try to make this a little cleaner, I'm wondering if there's a way to leverage a lookup table in order to just read in the domains to ignore via a loop? If not, no big deal... but simply appending to the end of a "domains.ignore" file would be a lot easier than having to edit the search itself daily.&lt;/P&gt;

&lt;P&gt;Thanks in advance for any help with this.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Nov 2010 22:45:14 GMT</pubDate>
    <dc:creator>tmeader</dc:creator>
    <dc:date>2010-11-01T22:45:14Z</dc:date>
    <item>
      <title>Lookup table from external file for search exclusions possible?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81418#M20627</link>
      <description>&lt;P&gt;I've currently got a summary search setup going against DNS query data that I use to produce a reporting chart of the top 50 searches over the past 3 days. As part of this, I generally go through every couple days to see what is showing up in the top 50 that isn't interesting and can be discarded from the chart. This basically amounts to then appending another "query!="some.domain.y" (where "query" is a defined field in my dns eventtype") such as:&lt;/P&gt;

&lt;P&gt;sourcetype="dns" query_type="A" query!="some.domain.x" | sitop query limit="50"&lt;/P&gt;

&lt;P&gt;At this point though, this has made my search quite long as there's probably upwards of 30 or so "query!=xxxx" statements appended now. To try to make this a little cleaner, I'm wondering if there's a way to leverage a lookup table in order to just read in the domains to ignore via a loop? If not, no big deal... but simply appending to the end of a "domains.ignore" file would be a lot easier than having to edit the search itself daily.&lt;/P&gt;

&lt;P&gt;Thanks in advance for any help with this.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2010 22:45:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81418#M20627</guid>
      <dc:creator>tmeader</dc:creator>
      <dc:date>2010-11-01T22:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table from external file for search exclusions possible?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81419#M20628</link>
      <description>&lt;P&gt;Sure, this is pretty easy to do.&lt;/P&gt;

&lt;P&gt;Create a CSV-based lookup table with two columns, e.g.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;query, ignored
"some.domain.x","true"
"some.domain.y","true"
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When you call the lookup, any values for &lt;CODE&gt;query&lt;/CODE&gt; not in your CSV list will have an empty value for &lt;CODE&gt;ignored&lt;/CODE&gt;. So, your search becomes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="dns" query_type="A"
| lookup domainsToIgnore query OUTPUT ignored
| search NOT ignored=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need more more general information on how to create the lookup table, take a look at:
&lt;A href="http://www.splunk.com/base/Documentation/latest/Knowledge/Addfieldsfromexternaldatasources" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Knowledge/Addfieldsfromexternaldatasources&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2010 00:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81419#M20628</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-11-02T00:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table from external file for search exclusions possible?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81420#M20629</link>
      <description>&lt;P&gt;Hmm, well, it's unfortunate that the name of your field is &lt;CODE&gt;query&lt;/CODE&gt;, otherwise this would work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="dns" query_type=A NOT [inputlookup excluded_queries | fields query]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the problem is that a field named either &lt;CODE&gt;query&lt;/CODE&gt; or &lt;CODE&gt;search&lt;/CODE&gt; is treated specially by subsearch. If you renamed the field in your original sourcetype from &lt;CODE&gt;query&lt;/CODE&gt; to, say, &lt;CODE&gt;qry&lt;/CODE&gt;, then this would work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="dns" query_type=A NOT [inputlookup excluded_queries | fields qry]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In 4.1.5, I think you'll be unlikely to have problems, but in earlier version (including earlier 4.1 releases), you may run into a 100-term limit that a subsearch will return, which would need to be raised in &lt;CODE&gt;limits.conf&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2010 00:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81420#M20629</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-11-02T00:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table from external file for search exclusions possible?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81421#M20630</link>
      <description>&lt;P&gt;gkanapathy, was that second search line supposed to be identical to the first? Or was it supposed to end in "| fields qry]" instead? It's fairly simple for me to change that field name if need be (probably to "dns_query" actually), so I might go your route. In that case, I'm assuming it would be: "| fields dns_query]" at the end, and the lookup file would just be a list of the domains (one per line)?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81421#M20630</guid>
      <dc:creator>tmeader</dc:creator>
      <dc:date>2020-09-28T09:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table from external file for search exclusions possible?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81422#M20631</link>
      <description>&lt;P&gt;yes, edited now.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2010 01:01:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81422#M20631</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-11-02T01:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup table from external file for search exclusions possible?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81423#M20632</link>
      <description>&lt;P&gt;The table would be a list of domains, one per line, except the first line would be the column/field name, &lt;CODE&gt;qry&lt;/CODE&gt; or &lt;CODE&gt;dns_query&lt;/CODE&gt;. You could use the &lt;CODE&gt;rename&lt;/CODE&gt; command if it's different, but you might as well make it the same as in your sourcetype.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2010 01:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-table-from-external-file-for-search-exclusions-possible/m-p/81423#M20632</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-11-02T01:03:34Z</dc:date>
    </item>
  </channel>
</rss>

