<?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 use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238525#M70853</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup HostList.csv 
| eval count=0 
| eval host=upper(host) 
| append [ 
|metasearch index=main latest=-7d
| eval host=upper(host) 
| stats count by host
] 
| stats sum(count) AS Total by host 
| where Total=0
| table host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;after you can use eval to show the status or rangemap (see the dashboard example "Table Iconset (Rangemap)" in "Splunk 6.x Dashboard Examples".&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2016 14:14:37 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2016-07-06T14:14:37Z</dc:date>
    <item>
      <title>How to use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output "yes" or "no"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238522#M70850</link>
      <description>&lt;P&gt;I want to inputlookup a CSV and search the hosts in the CSV to see if they have been reporting into Splunk, and then table a report that will have the host names from the CSV with an added column that displays "yes" or "no". Not sure how I can use the eval statement to do something like  &lt;CODE&gt;eval if count is 0=no if &amp;gt;0=yes&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 14:05:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238522#M70850</guid>
      <dc:creator>sbattista09</dc:creator>
      <dc:date>2016-07-06T14:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output "yes" or "no"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238523#M70851</link>
      <description>&lt;P&gt;You can use an eval like that&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| eval existing_field=if(count == "0", "No", "Yes")&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Another option if the field might exist and might not:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| eval existing_field=if(isnull(field), "No", "Yes")&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 14:12:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238523#M70851</guid>
      <dc:creator>gfreitas</dc:creator>
      <dc:date>2016-07-06T14:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output "yes" or "no"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238524#M70852</link>
      <description>&lt;P&gt;Something like this would get you most of the way there. I think. This would display a table of the host, the last time it reported, and then if it is reporting or not. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup servers.csv |  join type=left host [|metadata type=hosts ] | table host lastTime | eval reporting=case(isnull(lastTime), "no", 1=1, "yes") |  eval time=strftime(lastTime,"%b %d %T %Y %Z")  | fields - lastTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 14:13:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238524#M70852</guid>
      <dc:creator>ryanoconnor</dc:creator>
      <dc:date>2016-07-06T14:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output "yes" or "no"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238525#M70853</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup HostList.csv 
| eval count=0 
| eval host=upper(host) 
| append [ 
|metasearch index=main latest=-7d
| eval host=upper(host) 
| stats count by host
] 
| stats sum(count) AS Total by host 
| where Total=0
| table host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;after you can use eval to show the status or rangemap (see the dashboard example "Table Iconset (Rangemap)" in "Splunk 6.x Dashboard Examples".&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 14:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238525#M70853</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-07-06T14:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output "yes" or "no"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238526#M70854</link>
      <description>&lt;P&gt;You might want to use a case statement instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;input Lookup search | eval Results =case(count == 0, "Yes", count &amp;gt;= 0, "No")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also refer to this quick reference:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://www.splunk.com/content/dam/splunk2/pdfs/solution-guides/splunk-quick-reference-guide.pdf"&gt;https://www.splunk.com/content/dam/splunk2/pdfs/solution-guides/splunk-quick-reference-guide.pdf&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 06 Jul 2016 14:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238526#M70854</guid>
      <dc:creator>Stevelim</dc:creator>
      <dc:date>2016-07-06T14:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output "yes" or "no"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238527#M70855</link>
      <description>&lt;P&gt;is there a way to format the lastTime field so that it is more human readable? &lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 18:27:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238527#M70855</guid>
      <dc:creator>sbattista09</dc:creator>
      <dc:date>2016-07-06T18:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup to check if hosts in a CSV have been sending events to Splunk, then use eval to output "yes" or "no"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238528#M70856</link>
      <description>&lt;P&gt;Definitely, I just modified the search for you&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 18:41:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-to-check-if-hosts-in-a-CSV-have-been/m-p/238528#M70856</guid>
      <dc:creator>ryanoconnor</dc:creator>
      <dc:date>2016-07-06T18:41:01Z</dc:date>
    </item>
  </channel>
</rss>

