<?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 do a filtered list out of a lookup table? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257807#M4778</link>
    <description>&lt;P&gt;Try something like this. This should give you list of hosts in TeamA which have 0 events in selected time range&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os sourcetype=ps COMMAND=cron [inputlookup unix_hosts.csv | search AppTeam="TeamA" | fields host] | stats count by host | append [| inputlookup unix_hosts.csv | search AppTeam="TeamA" | fields host | eval count=0 ] | stats max(count) as count by host | where count=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Mar 2016 21:58:33 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-03-23T21:58:33Z</dc:date>
    <item>
      <title>How to do a filtered list out of a lookup table?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257806#M4777</link>
      <description>&lt;P&gt;We have a complex host lookup table which has many filtering fields in it.  This lookup table is also updated daily as our hosts change.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os sourcetype=ps COMMAND=cron [inputlookup unix_hosts.csv AppTeam=TeamA | fields host] | stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the example, AppTeam is one of the filter fields in the lookup table.&lt;/P&gt;

&lt;P&gt;The ultimate goal here is to Alert when there is a host with a count of 0 for the given process, but we need to filter down the search to a specific App Team.  The process being monitored is not always ubiquitous like cron is.&lt;/P&gt;

&lt;P&gt;We do have the lookup table set up as an automatic lookup, so AppTeam is a searchable field, but the list of hosts for 'TeamA' needs to be generated independent of any of the indexed events.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 21:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257806#M4777</guid>
      <dc:creator>cb_usps</dc:creator>
      <dc:date>2016-03-23T21:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a filtered list out of a lookup table?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257807#M4778</link>
      <description>&lt;P&gt;Try something like this. This should give you list of hosts in TeamA which have 0 events in selected time range&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=os sourcetype=ps COMMAND=cron [inputlookup unix_hosts.csv | search AppTeam="TeamA" | fields host] | stats count by host | append [| inputlookup unix_hosts.csv | search AppTeam="TeamA" | fields host | eval count=0 ] | stats max(count) as count by host | where count=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Mar 2016 21:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257807#M4778</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-23T21:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a filtered list out of a lookup table?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257808#M4779</link>
      <description>&lt;P&gt;Thank you.&lt;BR /&gt;
'append' is a handy tool to have &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:13:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257808#M4779</guid>
      <dc:creator>cb_usps</dc:creator>
      <dc:date>2016-03-24T14:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a filtered list out of a lookup table?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257809#M4780</link>
      <description>&lt;P&gt;somesoni - your answer was great and has helped me tremendously.&lt;BR /&gt;
I've learned a new trick now, and the following search runs slightly faster.  Beginning with the inputlookup and negating the hosts with matching events in the index produces the availability alert in a fashion easier to understand for newbies.&lt;BR /&gt;
I also threw in a ready-to-go message.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup unix_hosts.csv | search AppTeam="TeamA" | search NOT [search index=os sourcetype=ps USER=root AND COMMAND=cron earliest=-2m@m latest=-1m@m | fields host] | eval minus_1=tostring(strftime(relative_time(now(),"-1m@m"),"%+")) | eval message=replace("cron (root) not running at minus_1","minus_1",minus_1) | fields host message
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 May 2016 15:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-do-a-filtered-list-out-of-a-lookup-table/m-p/257809#M4780</guid>
      <dc:creator>cb_usps</dc:creator>
      <dc:date>2016-05-13T15:59:42Z</dc:date>
    </item>
  </channel>
</rss>

