<?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 table the hosts missing in splunk with lookup file for span=1d  and for 7 days in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-table-the-hosts-missing-in-splunk-with-lookup-file-for/m-p/529176#M149412</link>
    <description>&lt;P&gt;When you run that query what do you get?&amp;nbsp; How is that different from what you expect to get?&lt;/P&gt;&lt;P&gt;When working with subsearches it helps to start with the subsearch by itself.&amp;nbsp; Do that and you'll probably get an error message about the stats command not having a "span=1d" option.&amp;nbsp; That's easily fixed by removing the option - it doesn't make sense in this context.&amp;nbsp; Something that doesn't make sense is using the distinct_count function.&amp;nbsp; Knowing you have 99 hosts reporting doesn't help, either.&amp;nbsp; Expanding the subsearch results in "search NOT 99" - not very useful, is it?&amp;nbsp; I'll let you determine if "test.log" is a valid sourcetype and "Host" and valid field in your environment.&lt;/P&gt;&lt;P&gt;Once you have a working subsearch, add "| format" to it.&amp;nbsp; This will show the string that will be added to the search command.&amp;nbsp; If the result is not valid as part of "search NOT" then the subsearch will have to be modified.&lt;/P&gt;&lt;P&gt;Finally (for now), the ServersNotReporting field doesn't exist so the final report will be a list of timestamps and an empty column.&lt;/P&gt;&lt;P&gt;Here's a suggested query&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup HostDetails.csv | fields Host country datacenter 
| search NOT [search index=_internal sourcetype="test.log" | dedup host | return 1000 host ]
| eval Time = strftime(_time, "%Y-%d-%m") | rename host as ServersNotReporting | table Time ServersNotReporting&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 16:56:25 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-11-12T16:56:25Z</dc:date>
    <item>
      <title>how to table the hosts missing in splunk with lookup file for span=1d  and for 7 days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-table-the-hosts-missing-in-splunk-with-lookup-file-for/m-p/529163#M149407</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I've been poking around Splunk Answers for a while today and can't quite match the scenario I've got.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a 100 hosts in lookup And in splunk index, mostly reports 100 hosts but sometime few servers will miss reporting. I want to have a table with date and "ServersNotReporting"&lt;BR /&gt;&lt;BR /&gt;| inputlookup HostDetails.csv | table Host country datacenter&amp;nbsp;&lt;BR /&gt;| search NOT [search index=_internal sourcetype="test.log" | stats dc(Host) AS host&amp;nbsp;span=1d ]&lt;BR /&gt;| eval Time = strftime(_time, "%Y-%d-%m") | fields - _time | table Time ServersNotReporting&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Probably my approach&amp;nbsp;is wrong, but I don't know how to do this. Please help.. Thanks in Advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 16:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-table-the-hosts-missing-in-splunk-with-lookup-file-for/m-p/529163#M149407</guid>
      <dc:creator>vvemula</dc:creator>
      <dc:date>2020-11-12T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to table the hosts missing in splunk with lookup file for span=1d  and for 7 days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-table-the-hosts-missing-in-splunk-with-lookup-file-for/m-p/529176#M149412</link>
      <description>&lt;P&gt;When you run that query what do you get?&amp;nbsp; How is that different from what you expect to get?&lt;/P&gt;&lt;P&gt;When working with subsearches it helps to start with the subsearch by itself.&amp;nbsp; Do that and you'll probably get an error message about the stats command not having a "span=1d" option.&amp;nbsp; That's easily fixed by removing the option - it doesn't make sense in this context.&amp;nbsp; Something that doesn't make sense is using the distinct_count function.&amp;nbsp; Knowing you have 99 hosts reporting doesn't help, either.&amp;nbsp; Expanding the subsearch results in "search NOT 99" - not very useful, is it?&amp;nbsp; I'll let you determine if "test.log" is a valid sourcetype and "Host" and valid field in your environment.&lt;/P&gt;&lt;P&gt;Once you have a working subsearch, add "| format" to it.&amp;nbsp; This will show the string that will be added to the search command.&amp;nbsp; If the result is not valid as part of "search NOT" then the subsearch will have to be modified.&lt;/P&gt;&lt;P&gt;Finally (for now), the ServersNotReporting field doesn't exist so the final report will be a list of timestamps and an empty column.&lt;/P&gt;&lt;P&gt;Here's a suggested query&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup HostDetails.csv | fields Host country datacenter 
| search NOT [search index=_internal sourcetype="test.log" | dedup host | return 1000 host ]
| eval Time = strftime(_time, "%Y-%d-%m") | rename host as ServersNotReporting | table Time ServersNotReporting&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 16:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-table-the-hosts-missing-in-splunk-with-lookup-file-for/m-p/529176#M149412</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-12T16:56:25Z</dc:date>
    </item>
  </channel>
</rss>

