<?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 find a host which is missing a specific value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499656#M139147</link>
    <description>&lt;PRE&gt;&lt;CODE&gt; sourcetype=openPorts host=*511100471375*
| stats values(Port) as Port by host
| where isnull(mvfind(Port,2000))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query displays a list of open ports on the host and excludes those that contain port 2000.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2019 13:31:11 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2019-12-02T13:31:11Z</dc:date>
    <item>
      <title>How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499651#M139142</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;My question is focused on open ports but the condition applies to a wide range of scenarios. My question is the following:&lt;/P&gt;

&lt;P&gt;I need to create alerts for specific ports when they are not open, and my query looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=openPorts Port=2000  | search host=*foo*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This checks all the hosts with "foo" in their name for open port 2000. My question is, how do I define a search that returns the hosts that do NOT have the specified port open. When I try to amend the query with eith using "NOT" or "!=" I get all port values that are not 2000. How do I get the results that do not have that value at all?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 09:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499651#M139142</guid>
      <dc:creator>galindimitrov</dc:creator>
      <dc:date>2019-12-02T09:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499652#M139143</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype=openPorts Port IN (80,8080,10080,...)    host=*foo*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @galindimitrov&lt;BR /&gt;
I think you can use &lt;CODE&gt;IN&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 11:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499652#M139143</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-02T11:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499653#M139144</link>
      <description>&lt;P&gt;@to4kawa, &lt;BR /&gt;
It looks good on a first glance, but in my case I do not believe it is very applicable. For example host X may have the needed port open and it will show in the query, after some time something happens and the port is closed now. Using IN lets me filter by a range, but what I need is to know which host does not have the value in the query, like in the above example port 2000. But if I just look for results in a range then, I will potentially get hosts that also have the port open even though it may not be specified in the query, &lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 12:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499653#M139144</guid>
      <dc:creator>galindimitrov</dc:creator>
      <dc:date>2019-12-02T12:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499654#M139145</link>
      <description>&lt;P&gt;Give examples of host and port status and indicate when you want results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=openPorts NOT Port IN (80,8080,10080,...)    host=*foo*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think this is good.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 12:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499654#M139145</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-02T12:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499655#M139146</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype=openPorts Port IN (8076,9999,5555,8283,8284,8092,8093,9899)  | search host=*511100471375* | table host Port
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://imgur.com/0qKvapm"&gt;https://imgur.com/0qKvapm&lt;/A&gt;&lt;BR /&gt;
This query will return all the hosts with 511100471375 in their names with open ports corresponding to the range given in the IN operator. However that does not mean that port 2000 is not open on any of the hosts in the results. So if my query looks like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    sourcetype=openPorts Port IN 8076,9999,5555,8283,8284,8092,8093,9899,2000)  | search host=*511100471375* | table host Port
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I will get the same results as the last query, with an additional entry for each host that has port 2000 open. What I am looking to achieve is to set an alarm to be triggered when a port is no longer open or is not present in the open ports on a given host and I need to see which hosts no longer have the port open. Lets say the logic I am looking for is  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=openports return hosts that do not have Port=2000| table host Port
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:09:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499655#M139146</guid>
      <dc:creator>galindimitrov</dc:creator>
      <dc:date>2019-12-02T13:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499656#M139147</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; sourcetype=openPorts host=*511100471375*
| stats values(Port) as Port by host
| where isnull(mvfind(Port,2000))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query displays a list of open ports on the host and excludes those that contain port 2000.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499656#M139147</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-02T13:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499657#M139148</link>
      <description>&lt;P&gt;Hi @galindimitrov,&lt;/P&gt;

&lt;P&gt;You can create a lookup which contains pattern matching hosts and you can use it in your query.&lt;/P&gt;

&lt;P&gt;sourcetype=openPorts Port=2000     | search host=&lt;EM&gt;foo&lt;/EM&gt; NOT [| inputlookup lookup_filename.csv | fields host]&lt;/P&gt;

&lt;P&gt;If it helps you, please accept it as an answer.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Tejas&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499657#M139148</guid>
      <dc:creator>tbavarva</dc:creator>
      <dc:date>2019-12-02T13:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499658#M139149</link>
      <description>&lt;P&gt;Correcting host matching pattern.&lt;/P&gt;

&lt;P&gt;sourcetype=openPorts Port=2000 | search host="&lt;EM&gt;foo&lt;/EM&gt;" NOT [| inputlookup lookup_filename.csv | fields host]&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Tejas&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 14:00:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499658#M139149</guid>
      <dc:creator>tbavarva</dc:creator>
      <dc:date>2019-12-02T14:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499659#M139150</link>
      <description>&lt;P&gt;Thank you, I will test it out tomorrow and let you know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 15:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499659#M139150</guid>
      <dc:creator>galindimitrov</dc:creator>
      <dc:date>2019-12-02T15:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499660#M139151</link>
      <description>&lt;P&gt;I will check tomorrow and let you know, thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 15:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499660#M139151</guid>
      <dc:creator>galindimitrov</dc:creator>
      <dc:date>2019-12-02T15:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a host which is missing a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499661#M139152</link>
      <description>&lt;P&gt;Why is this not sufficient?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="openPorts"
| stats count(eval(Port="2000")) AS port2000 BY host
| where port2000=="0"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:18:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-host-which-is-missing-a-specific-value/m-p/499661#M139152</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-02T21:18:47Z</dc:date>
    </item>
  </channel>
</rss>

