<?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: Can you help me with the following search using a lookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393204#M114398</link>
    <description>&lt;P&gt;Thanks.  These are both very good, it looks like woodcock's is more what I'm looking to implement.  Is there anyway to limit the results per host?  I tried "top limit=x", but that didn't work. &lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 18:15:46 GMT</pubDate>
    <dc:creator>a212830</dc:creator>
    <dc:date>2018-09-26T18:15:46Z</dc:date>
    <item>
      <title>Can you help me with the following search using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393201#M114395</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We are frequently required to validate that data is being received by Splunk from multiple servers.  The lists of IPs/hosts can be quite long.   I am trying to come up with a search that will make this easier, like putting the entries into lookup files and then running a search against the entries in the lookups.  So far, I have a lookup with a hostname, IP, and potentially, a wildcard for that host (sometimes the hosts are fully qualified and sometimes they are not). The IPs are reported as hosts, not as a separate "ip" field. &lt;/P&gt;

&lt;P&gt;By using this search, I can retrieve data for hosts:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* [|inputlookup testSVB2.csv|table host ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there anyway to expand this so it it will run a search against matching hosts OR IPs OR wildcards? When I table out host or IP, it seems to be running an "AND", rather than an "OR". &lt;/P&gt;

&lt;P&gt;Finally, is there anyway to limit the number of events returned per host?     &lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 17:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393201#M114395</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2018-09-26T17:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the following search using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393202#M114396</link>
      <description>&lt;P&gt;You can achieve that using map command&lt;BR /&gt;
|inputlookup estSVB2.csv|fields host ip| map search="index=* host=$host$ OR ip=$ip$| table host ip"&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 17:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393202#M114396</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-09-26T17:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the following search using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393203#M114397</link>
      <description>&lt;P&gt;You need the &lt;CODE&gt;format&lt;/CODE&gt; command; here is a run-anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval raw="host1,ip1 host2,ip2 host3,ip3"
| makemv raw
| mvexpand raw
| rename raw AS _raw
| rex "^(?&amp;lt;host&amp;gt;\w+),(?&amp;lt;ip&amp;gt;\w+)$"
| table host ip
| format "(" "(" "OR" ")" "OR" ")"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your case, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* [|inputlookup testSVB2.csv | table host ip | format "(" "(" "OR" ")" "OR" ")"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To limit the number of events per host just do this (I have chosen to limit to 10):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* [|inputlookup testSVB2.csv | table host ip | format "(" "(" "OR" ")" "OR" ")"]
| dedup 10 host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Sep 2018 18:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393203#M114397</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-09-26T18:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the following search using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393204#M114398</link>
      <description>&lt;P&gt;Thanks.  These are both very good, it looks like woodcock's is more what I'm looking to implement.  Is there anyway to limit the results per host?  I tried "top limit=x", but that didn't work. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 18:15:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393204#M114398</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2018-09-26T18:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the following search using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393205#M114399</link>
      <description>&lt;P&gt;Figured it out.  Add a "top limit=x host" to the end.  &lt;/P&gt;

&lt;P&gt;Also came up with a way to do the same thing via tstats, which is much faster.  &lt;/P&gt;

&lt;P&gt;Thanks! &lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 18:45:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393205#M114399</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2018-09-26T18:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the following search using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393206#M114400</link>
      <description>&lt;P&gt;"We are frequently required to validate that data is being received by Splunk from multiple servers."&lt;BR /&gt;
What about the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/DMC/ForwardersDeployment"&gt;Monitoring Console&lt;/A&gt;'s page for Forwarders?&lt;/P&gt;

&lt;P&gt;I use the alerts in MC as well to let me know of missing forwarders&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 17:29:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-following-search-using-a-lookup/m-p/393206#M114400</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2018-10-15T17:29:27Z</dc:date>
    </item>
  </channel>
</rss>

