<?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: Not eventtype in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197043#M56892</link>
    <description>&lt;P&gt;As a result, editing single values does not require touching the entire list but rather an individual stanza.&lt;/P&gt;

&lt;P&gt;As an additional bonus, the regular Splunk Search UI allows you to graphically add new values to an existing tag.&lt;/P&gt;

&lt;P&gt;Looking at the search inspector for a search with tags in it you can see that this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventSearch:    search index=_internal tag=foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gets translated into this (I've tagged two sourcetypes with foo):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;normalizedSearch:   litsearch index=_internal ( sourcetype=splunk_web_service OR sourcetype=splunkd_access )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's very similar to the translation for eventtypes.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Mar 2014 12:26:52 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-03-21T12:26:52Z</dc:date>
    <item>
      <title>Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197036#M56885</link>
      <description>&lt;P&gt;Is it possible to create an eventtype called dns_google set as "src_ip=8.8.8.8 src_ip=4.2.2.2" and then treat it like a subsearch with a "not" like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch NOT (eventtype=dns_google)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The goal would be to filter our 8.8.8.8 and 4.2.2.2 without putting "not" (!) into the eventtype itself so that other searches could use dns_google (for example) to match events which came from those ip addresses.  The address list I have in mind is a bit larger but probably not large enough to merit a lookup table, which I still need to practice creating and using.&lt;/P&gt;

&lt;P&gt;In this case, the task is only an example and not an important part of the question, whereas understanding if eventtype can be used with a "not" is the primary purpose here.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197036#M56885</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2020-09-28T16:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197037#M56886</link>
      <description>&lt;P&gt;Have you looked at tagging those key/value pairs?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Abouttagsandaliases"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Abouttagsandaliases&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 23:30:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197037#M56886</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-03-20T23:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197038#M56887</link>
      <description>&lt;P&gt;Yeah, this is straightforward with eventtypes. They're just syntactic sugar for their long-form search syntax, so you can combine them with a NOT operator. To use your example, you'd define an eventtype like this in eventtypes.conf (note the OR operator!):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[google_dns]
search = src_ip=8.8.8.8 OR src_ip=4.2.2.2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can do a search like this to only load Google's DNS servers:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch eventtype=dns_google
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That gets translated behind the scenes into this (see the job inspector's normalizedSearch output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch ( ( src_ip=8.8.8.8 OR src_ip=4.2.2.2 ) )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Similarly, if you search for this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch NOT eventtype=dns_google
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That gets translated into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch NOT ( ( src_ip=8.8.8.8 OR src_ip=4.2.2.2 ) )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If your eventtype is a large list of values for a single field, you're probably better off using tags as Kristian suggested. That way you can add and edit individual values without touching a huge monolithic search string. Both work in similar fashion though, as syntactic sugar for the long-form search language, and support the NOT operator.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 00:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197038#M56887</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-21T00:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197039#M56888</link>
      <description>&lt;P&gt;well put.&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 07:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197039#M56888</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-03-21T07:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197040#M56889</link>
      <description>&lt;P&gt;I really like the idea of tags but I can't see the difference between them and eventtypes.  Why are large lists better done with tags than with eventtypes?  Is it because a large list in an eventtype pushes down all the other eventtypes to make it hard to find the eventtype of interest in the eventtype manager page?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 11:53:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197040#M56889</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-21T11:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197041#M56890</link>
      <description>&lt;P&gt;For the record in support of this question/thread, the linked page on tags gives the following example use of tags grouping the same IP addresses by different criteria: tag=router tag=SF NOT (tag=Building1)&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 12:24:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197041#M56890</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-21T12:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197042#M56891</link>
      <description>&lt;P&gt;From a searching / performance POV, tags and eventtypes behave very similarly. Both get translated into their long-form SPL representation, and both support operators such as NOT.&lt;/P&gt;

&lt;P&gt;The difference I see is in maintaining that list of IPs. With an eventtype you have one eventtype that contains a very long list of &lt;CODE&gt;src_ip=foo OR ...&lt;/CODE&gt; entries, so to for example remove an entry you need to manually edit a large string.&lt;BR /&gt;
On the other hand, tags are stored as individual values under a common name like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[src_ip=8.8.8.8]
google_dns=enabled

[src_ip=8.4.4.4]
google_dns=enabled
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Mar 2014 12:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197042#M56891</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-21T12:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197043#M56892</link>
      <description>&lt;P&gt;As a result, editing single values does not require touching the entire list but rather an individual stanza.&lt;/P&gt;

&lt;P&gt;As an additional bonus, the regular Splunk Search UI allows you to graphically add new values to an existing tag.&lt;/P&gt;

&lt;P&gt;Looking at the search inspector for a search with tags in it you can see that this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventSearch:    search index=_internal tag=foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gets translated into this (I've tagged two sourcetypes with foo):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;normalizedSearch:   litsearch index=_internal ( sourcetype=splunk_web_service OR sourcetype=splunkd_access )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's very similar to the translation for eventtypes.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 12:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197043#M56892</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-21T12:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197044#M56893</link>
      <description>&lt;P&gt;Perhaps you meant that tags are not well suited for large lists because you have to add each field-value pair individually, one at a time, whereas eventtypes allow for a large list to be pasted into the definition box all at once.  I have just saved many pairs successfully into a single field-value pair box.  Will that work properly or must each pair be placed in its own box?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 12:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197044#M56893</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-21T12:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197045#M56894</link>
      <description>&lt;P&gt;For batch-adding a large number of tags from a precompiled list you're better off sed'ing that list into a list of tags.conf stanzas and adding that to the config file manually. Through the UI you're going to be busy for a long time adding hundreds or thousands of tags.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 12:31:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197045#M56894</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-21T12:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197046#M56895</link>
      <description>&lt;P&gt;I learned through trying both eventtype and tags in this context that it is vital that the "not" be all uppercase with parenthesis around the terms: NOT (eventtype=event1) NOT (tag=tag1)&lt;BR /&gt;
Issue: A tag field-value combination with an * did not remove a matching domain when the NOT operator was used on it.  Thus my confidence in tags has dropped.  I am still curious whether multiple field value search terms within a single tag field-value box breaks the tag or not.  Are those boxes just to allow for search term separation, searching, and association manipulation of tags field-value combinations?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 15:29:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197046#M56895</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-21T15:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197047#M56896</link>
      <description>&lt;P&gt;Yeah, boolean operators are all upper caps - else you're looking for the word "not".&lt;/P&gt;

&lt;P&gt;What "field-value box" are you talking about? It's best to post the tags.conf stanzas in question, then we are all talking about the same thing.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 16:01:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197047#M56896</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-21T16:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197048#M56897</link>
      <description>&lt;P&gt;I am talking about the text field located at the Web interface-Settings-Tags-List by tag name-New-Field Value pair  I agree that "sed'ing that list into a list of tags.conf stanzas" is the most approach to Tag creation.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 19:14:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197048#M56897</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-03-21T19:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Not eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197049#M56898</link>
      <description>&lt;P&gt;Ah. Entering more than one field-value pair will make that entry useless. For example, entering "host=a host=b" for tag "foo" will create a stanza in tags.conf like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host=a%20host%3Db]
foo = enabled
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In other words, it's looking for a host called "a host=b" - that's a valid field value (maybe not for host though), but probably not what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 20:48:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-eventtype/m-p/197049#M56898</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-21T20:48:40Z</dc:date>
    </item>
  </channel>
</rss>

