<?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 do I use a look up to check to see if I'm getting logs from hosts that are in a CSV? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457197#M129182</link>
    <description>&lt;P&gt;286 results have the lookup columns added.  Do you want to see the count of hosts in the lookup not reporting in from your search time window?  If so, instead of lookup, use &lt;CODE&gt;| append [| inputlookup client_sys]&lt;/CODE&gt; and then uses a stats to bring the two together to show which are not shown, a filter on those not present in the data, and then a stats to count the ones not filtered.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count AS tstats_cnt where index = main OR index = client* by host | append [| inputlookup client_sys | rename hostname AS host ] | stats first(tstats_cnt) AS tstats_cnt by host | search NOT tstats_cnt=* | stats count AS host_dc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Sep 2018 15:25:17 GMT</pubDate>
    <dc:creator>landen99</dc:creator>
    <dc:date>2018-09-13T15:25:17Z</dc:date>
    <item>
      <title>How do I use a look up to check to see if I'm getting logs from hosts that are in a CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457192#M129177</link>
      <description>&lt;P&gt;Dears,&lt;/P&gt;

&lt;P&gt;I'm trying to use a lookup for Splunk to read a file and tell me if I'm collecting the logs to the host of that file.&lt;/P&gt;

&lt;P&gt;What I need: Check if I'm getting logs from hosts that are in a CSV.&lt;/P&gt;

&lt;P&gt;I am using the following query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = main OR index = client * | stats count by host | lookup client_sys hostname AS host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried using the &lt;CODE&gt;inputlookup&lt;/CODE&gt; command, but it did not work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = main OR index = client * NOT [| inputlookup client_sys.csv | fields host]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any other way to do this?&lt;/P&gt;

&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 12:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457192#M129177</guid>
      <dc:creator>wvalente</dc:creator>
      <dc:date>2018-09-13T12:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a look up to check to see if I'm getting logs from hosts that are in a CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457193#M129178</link>
      <description>&lt;P&gt;suppose &lt;CODE&gt;hostname&lt;/CODE&gt; is column name in &lt;CODE&gt;client_sys.csv&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;can you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup client_sys.csv | rename hostname as host | table host |join type=outer host [|  tstats count where index=* by host ] | fillnull count value="NA" | search count=NA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query should give you list of hosts which do not have any data&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 12:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457193#M129178</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-09-13T12:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a look up to check to see if I'm getting logs from hosts that are in a CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457194#M129179</link>
      <description>&lt;P&gt;[edit] You need to use append inputlookup to see hosts not reporting in.  Also I recommend tstats since you only use host:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count AS tstats_cnt where index = main OR index = client* by host | append [| inputlookup client_sys | rename hostname AS host ] | stats first(tstats_cnt) AS tstats_cnt by host | search NOT tstats_cnt=* | stats count AS host_dc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Other notes:  client* had a space between which didn't make sense so I combined them.  client_sys should be a lookup definition properly defined with a connection to an uploaded lookup file ending in .csv  Double check the field name hostname in the lookup file.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 13:06:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457194#M129179</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2018-09-13T13:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a look up to check to see if I'm getting logs from hosts that are in a CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457195#M129180</link>
      <description>&lt;P&gt;better to avoid subsearches and replace inputlookup with lookup.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 13:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457195#M129180</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2018-09-13T13:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a look up to check to see if I'm getting logs from hosts that are in a CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457196#M129181</link>
      <description>&lt;P&gt;@landen99 I tried first the search |tstats count where index = main OR index = client* by host and return me 286 results.&lt;/P&gt;

&lt;P&gt;When I put the whole command return the same results.&lt;/P&gt;

&lt;P&gt;Do I have to write something after OUTPUT?&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 14:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457196#M129181</guid>
      <dc:creator>wvalente</dc:creator>
      <dc:date>2018-09-13T14:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a look up to check to see if I'm getting logs from hosts that are in a CSV?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457197#M129182</link>
      <description>&lt;P&gt;286 results have the lookup columns added.  Do you want to see the count of hosts in the lookup not reporting in from your search time window?  If so, instead of lookup, use &lt;CODE&gt;| append [| inputlookup client_sys]&lt;/CODE&gt; and then uses a stats to bring the two together to show which are not shown, a filter on those not present in the data, and then a stats to count the ones not filtered.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count AS tstats_cnt where index = main OR index = client* by host | append [| inputlookup client_sys | rename hostname AS host ] | stats first(tstats_cnt) AS tstats_cnt by host | search NOT tstats_cnt=* | stats count AS host_dc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:25:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-look-up-to-check-to-see-if-I-m-getting-logs-from/m-p/457197#M129182</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2018-09-13T15:25:17Z</dc:date>
    </item>
  </channel>
</rss>

