<?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: SPL querry help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535317#M151291</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230356"&gt;@srujana96&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;my first search gives you the list of servers that are in lookup but not in the search results.&lt;/P&gt;&lt;P&gt;You have to adapt the logic of this approach to your needs!&lt;/P&gt;&lt;P&gt;in other words; you have to define a search to find all the servers that match a condition (e.g. Status=Success) and then compare results with the lookup using my method.&lt;/P&gt;&lt;P&gt;So if you want to check which of your servers has Status=Success, you can run a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myserveridx Status=Success
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup X | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total
| where total=0&lt;/LI-CODE&gt;&lt;P&gt;In this way you have all the servers from your list that haven't Status=Success.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2021 08:52:39 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-01-11T08:52:39Z</dc:date>
    <item>
      <title>SPL querry help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535300#M151283</link>
      <description>&lt;P&gt;I have a lookup table X which contains list of Servers, my indexer(myserveridx) contains list of server which are up and running. i want to write a querry to get the name of server which are present in lookup table but not in index.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 07:24:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535300#M151283</guid>
      <dc:creator>srujana96</dc:creator>
      <dc:date>2021-01-11T07:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: SPL querry help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535301#M151284</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230356"&gt;@srujana96&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;assuming that the host field in lookup is named "host", you have to run a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=myserveridx
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup X | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total
| where total=0&lt;/LI-CODE&gt;&lt;P&gt;In this way you can create an alert to periodically run (e.g. every 5 minutes) to check your perimeter.&lt;/P&gt;&lt;P&gt;You can use the same search (replacing the last row) to display a status of your infrastruture:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=myserveridx
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup X | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total
| eval status=if(total=0,"Down","Up")
| table host status&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 07:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535301#M151284</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-01-11T07:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: SPL querry help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535314#M151289</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply.&lt;BR /&gt;the querry which you have sent is giving me the overall count.&lt;BR /&gt;but my expectation is to get the count of the Server which are in lookup table but not in my index&lt;BR /&gt;for example i have pasted the below excel sheet for your reference in that i want the count server that are not patched i have highlighted for your reference&lt;BR /&gt;&lt;BR /&gt;In this below excel sheet the servers which are not patched are 1,3,5,7 and 9 so my count is 5.&lt;/P&gt;&lt;TABLE width="628"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64"&gt;Lookup&lt;/TD&gt;&lt;TD width="64"&gt;Index&lt;/TD&gt;&lt;TD width="64"&gt;Status&lt;/TD&gt;&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="117"&gt;server patched&lt;/TD&gt;&lt;TD width="64"&gt;Success&lt;/TD&gt;&lt;TD width="64"&gt;Failure&lt;/TD&gt;&lt;TD width="127"&gt;&lt;STRONG&gt;server not patched&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Success&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Success&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;Success&l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lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 11 Jan 2021 08:41:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535314#M151289</guid>
      <dc:creator>srujana96</dc:creator>
      <dc:date>2021-01-11T08:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: SPL querry help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535317#M151291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230356"&gt;@srujana96&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;my first search gives you the list of servers that are in lookup but not in the search results.&lt;/P&gt;&lt;P&gt;You have to adapt the logic of this approach to your needs!&lt;/P&gt;&lt;P&gt;in other words; you have to define a search to find all the servers that match a condition (e.g. Status=Success) and then compare results with the lookup using my method.&lt;/P&gt;&lt;P&gt;So if you want to check which of your servers has Status=Success, you can run a search like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myserveridx Status=Success
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup X | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total
| where total=0&lt;/LI-CODE&gt;&lt;P&gt;In this way you have all the servers from your list that haven't Status=Success.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 08:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPL-querry-help/m-p/535317#M151291</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-01-11T08:52:39Z</dc:date>
    </item>
  </channel>
</rss>

